Skip to content

Commit 2ed17ea

Browse files
committed
fix(ci): improved
1 parent a51d342 commit 2ed17ea

1 file changed

Lines changed: 26 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,46 @@ jobs:
6565
steps:
6666
- uses: actions/checkout@v4
6767
- uses: Swatinem/rust-cache@v2
68-
68+
69+
- name: Sync version from tag
70+
run: |
71+
VERSION="${GITHUB_REF_NAME#v}"
72+
echo "Release version: $VERSION"
73+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
74+
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
75+
6976
- name: Install cargo-deb
7077
run: cargo install cargo-deb
71-
78+
7279
- name: Build release binary
7380
run: cargo build --release
74-
81+
7582
- name: Build .deb package
7683
run: cargo deb --no-build
77-
84+
85+
- name: Package binary tarball and checksum
86+
run: |
87+
ARCHIVE="baco-${VERSION}-x86_64-unknown-linux-gnu.tar.gz"
88+
tar -czf "$ARCHIVE" -C target/release baco
89+
sha256sum "$ARCHIVE" > "$ARCHIVE.sha256"
90+
echo "ARCHIVE=$ARCHIVE" >> "$GITHUB_ENV"
91+
7892
- name: Upload artifacts
7993
uses: actions/upload-artifact@v4
8094
with:
81-
name: baco-deb-package
82-
path: target/debian/*.deb
83-
95+
name: baco-release-assets
96+
path: |
97+
target/debian/*.deb
98+
baco-*.tar.gz
99+
baco-*.tar.gz.sha256
100+
84101
- name: Upload release assets
85102
uses: softprops/action-gh-release@v1
86103
if: startsWith(github.ref, 'refs/tags/v')
87104
with:
88105
files: |
89106
target/debian/*.deb
90-
target/release/baco
107+
baco-*.tar.gz
108+
baco-*.tar.gz.sha256
91109
env:
92110
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)