steps: - name: build-cross image: "xmake/xmake:ubuntu-latest" when: event: - push - tag environment: SHELL: "/bin/bash" commands: # 安装 git - apt-get update -y - apt-get install -y git # Linux release build - xmake f -m release - xmake -v - mkdir -p dist - cp `xmake u -o`/Fig dist/Fig-linux # Windows cross-build - xmake f -m release --plat=windows --arch=x86_64 --cc=x86_64-w64-mingw32-g++ --cxx=x86_64-w64-mingw32-g++ - xmake -v - cp `xmake u -o`/Fig.exe dist/Fig-windows.exe - name: gitea-release image: "xmake/xmake:ubuntu-latest" when: event: - tag environment: GITEA_TOKEN: from_secret: GITEA_TOKEN commands: - TAG=${DRONE_TAG} - echo "Uploading Fig binaries for tag $TAG to Gitea" # Linux binary - | curl -X POST -H "Authorization: token ${GITEA_TOKEN}" \ -F "name=Fig-linux" -F "file=@dist/Fig-linux" \ "https://git.fig-lang.cn/api/v1/repos/PuqiAR/Fig/releases/${TAG}/assets" # Windows binary - | curl -X POST -H "Authorization: token ${GITEA_TOKEN}" \ -F "name=Fig-windows.exe" -F "file=@dist/Fig-windows.exe" \ "https://git.fig-lang.cn/api/v1/repos/PuqiAR/Fig/releases/${TAG}/assets"