sdlan-lib-rs/.gitea/workflows/release-deb.yaml
2026-07-15 10:54:16 +08:00

45 lines
1.6 KiB
YAML

name: sdlan release push
run-name: ${{ gitea.actor }} is building release 🚀
on:
push:
tags:
- '*'
defaults:
run:
shell: bash --login -eo pipefail {0}
jobs:
build:
runs-on: self-hosted
steps:
- name: Add Path
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "$HOME/tools/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
- name: TAG推送自动编译
id: compile
shell: bash
working-directory: /usr/local/gitea-workflow/workspace/sdlan-lib-rs
run: |
flock -n build.lock -c '
git pull
rm -rf /usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/x86_64-unknown-linux-musl/debian/*.deb || true
rm -rf /usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/aarch64-unknown-linux-musl/debian/*.deb || true
cargo deb --target x86_64-unknown-linux-musl --deb-revision="2-static"
cargo deb --target aarch64-unknown-linux-musl --deb-revision="2-static"
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
uses: workflow-actions/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