Skip to content

Commit d146958

Browse files
committed
build(release): add strip, checksum, and publish steps to CI
1 parent c84def0 commit d146958

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
name: Build (${{ matrix.target }})
1717
runs-on: ${{ matrix.os }}
1818
strategy:
19+
fail-fast: false
1920
matrix:
2021
include:
2122
- target: x86_64-unknown-linux-gnu
@@ -52,6 +53,15 @@ jobs:
5253
env:
5354
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
5455

56+
- name: Strip binary (unix)
57+
if: runner.os != 'Windows'
58+
run: |
59+
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
60+
aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.artifact }}
61+
else
62+
strip target/${{ matrix.target }}/release/${{ matrix.artifact }}
63+
fi
64+
5565
- name: Package (unix)
5666
if: runner.os != 'Windows'
5767
run: |
@@ -83,8 +93,24 @@ jobs:
8393
path: artifacts
8494
merge-multiple: true
8595

96+
- name: Generate checksums
97+
run: |
98+
cd artifacts
99+
sha256sum * > sha256sums.txt
100+
86101
- name: Create release
87102
uses: softprops/action-gh-release@v2
88103
with:
89104
generate_release_notes: true
90105
files: artifacts/*
106+
107+
publish-crate:
108+
name: Publish to crates.io
109+
needs: release
110+
runs-on: ubuntu-latest
111+
steps:
112+
- uses: actions/checkout@v4
113+
- uses: dtolnay/rust-toolchain@stable
114+
- run: cargo publish
115+
env:
116+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)