33on :
44 push :
55 branches : [ main ]
6+ tags : [ 'v*' ]
67 pull_request :
78 branches : [ main ]
89
1819 include :
1920 - target : x86_64-unknown-linux-musl
2021 runs-on : ubuntu-24.04
21- # TODO: requires a public repository
22- # - target: aarch64-unknown-linux-musl
23- # runs-on: ubuntu-24.04-arm
22+ - target : aarch64-unknown-linux-musl
23+ runs-on : ubuntu-24.04-arm
2424 steps :
2525 - uses : actions/checkout@v4
2626 - uses : dtolnay/rust-toolchain@stable
@@ -31,10 +31,15 @@ jobs:
3131 - run : cargo build --release --target ${{ matrix.target }}
3232 env :
3333 RUSTFLAGS : " -C target-feature=+crt-static"
34+ - name : Rename binary with target architecture
35+ run : |
36+ mkdir -p dist
37+ cp target/${{ matrix.target }}/release/acolyte dist/acolyte-${{ matrix.target }}
3438 - uses : actions/upload-artifact@v4
3539 with :
3640 name : acolyte-${{ matrix.target }}
37- path : target/${{ matrix.target }}/release/acolyte
41+ path : dist/acolyte-${{ matrix.target }}
42+ retention-days : 7
3843
3944 lint-pre-commit :
4045 runs-on : ubuntu-latest
5964 - uses : dtolnay/rust-toolchain@stable
6065 - uses : Swatinem/rust-cache@v2
6166 - run : cargo test
67+
68+ release :
69+ runs-on : ubuntu-latest
70+ if : startsWith(github.ref, 'refs/tags/v')
71+ needs : [ build, lint-pre-commit, lint-rust, test-rust ]
72+ permissions :
73+ contents : write
74+ steps :
75+ - uses : actions/checkout@v4
76+ - name : Download binaries
77+ uses : actions/download-artifact@v4
78+ with :
79+ pattern : acolyte-*
80+ path : dist
81+ merge-multiple : true
82+ - name : Prepare binaries for release
83+ run : |
84+ chmod +x dist/*
85+ ls -la dist/
86+ du -sh dist/*
87+ - name : Create GitHub Release
88+ env :
89+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
90+ run : >-
91+ gh release create ${{ github.ref_name }}
92+ --title "Release ${{ github.ref_name }}"
93+ --generate-notes
94+ dist/*
0 commit comments