diff --git a/.gitea/workflows/update-image.yaml b/.gitea/workflows/update-image.yaml new file mode 100644 index 0000000..6c61d7a --- /dev/null +++ b/.gitea/workflows/update-image.yaml @@ -0,0 +1,34 @@ +name: sdlan release push +run-name: ${{ gitea.actor }} is building release 🚀 +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: self-hosted + steps: + - name: TAG推送自动编译 + id: compile + working-directory: /usr/local/gitea-workflow/workspace/sdlan-lib-rs + run: | + flock -n build.lock -c ' + rm /usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/x86_64-unknown-linux-musl/debian/*.deb || true + rm /usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/aarch64-unknown-linux-musl/debian/*.deb || true + make deb-musl + make deb-aarch64 + echo "built=true" >> $GITHUB_OUTPUT + ' || { + echo "其他编译正在进行中,跳过本次执行" + echo "built=false" >> $GITHUB_OUTPUT + exit 0 + } + + - name: Upload Release Assets + if: steps.compile.outputs.built == 'true' + uses: softprops/action-gh-release@v3 + with: + files: | + /usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/x86_64-unknown-linux-musl/debian/*.deb + /usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/aarch64-unknown-linux-musl/debian/*.deb \ No newline at end of file