Skip to content

Commit 406cbaf

Browse files
committed
Add release workflow triggered on GitHub release creation
Builds an optimized release binary on the self-hosted macOS runner, packages it as a tarball with SHA-256 checksum, and uploads both as release assets.
1 parent ad27c64 commit 406cbaf

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
14+
CARGO_NET_GIT_FETCH_WITH_CLI: true
15+
16+
jobs:
17+
build:
18+
name: Build release binary
19+
# Self-hosted macOS runner required for CommonCrypto FFI
20+
runs-on: spiceai-macos
21+
permissions:
22+
contents: write
23+
24+
steps:
25+
- name: Check out repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Rust toolchain
29+
uses: dtolnay/rust-toolchain@stable
30+
31+
- name: Cache Rust build artifacts
32+
uses: Swatinem/rust-cache@v2
33+
34+
- name: Build release binary
35+
run: cargo build --release --locked --bin spiceio
36+
37+
- name: Package binary
38+
run: |
39+
cd target/release
40+
tar czf spiceio-${{ runner.os }}-${{ runner.arch }}.tar.gz spiceio
41+
shasum -a 256 spiceio-${{ runner.os }}-${{ runner.arch }}.tar.gz > spiceio-${{ runner.os }}-${{ runner.arch }}.tar.gz.sha256
42+
43+
- name: Upload release assets
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
run: |
47+
gh release upload "${{ github.event.release.tag_name }}" \
48+
target/release/spiceio-${{ runner.os }}-${{ runner.arch }}.tar.gz \
49+
target/release/spiceio-${{ runner.os }}-${{ runner.arch }}.tar.gz.sha256

0 commit comments

Comments
 (0)