Skip to content

Commit 9951e40

Browse files
Your NameYour Name
authored andcommitted
Add macOS release workflow
1 parent 5a59c2e commit 9951e40

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release macOS Binary
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: macos-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Install Rust
19+
uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Build aarch64 binary
22+
run: |
23+
cargo build --release --target aarch64-apple-darwin
24+
mv target/aarch64-apple-darwin/release/werss-cli target/aarch64-apple-darwin/werss-cli
25+
26+
- name: Build x86_64 binary
27+
run: |
28+
rustup target add x86_64-apple-darwin
29+
cargo build --release --target x86_64-apple-darwin
30+
mv target/x86_64-apple-darwin/release/werss-cli target/x86_64-apple-darwin/werss-cli
31+
32+
- name: Create universal binary
33+
run: |
34+
mkdir -p dist
35+
lipo -create \
36+
target/aarch64-apple-darwin/werss-cli \
37+
target/x86_64-apple-darwin/werss-cli \
38+
-output dist/werss-cli
39+
40+
- name: Create tarball
41+
run: |
42+
tar -czvf dist/werss-cli-macos-universal.tar.gz -C dist werss-cli
43+
44+
- name: Generate SHA256 checksum
45+
run: |
46+
sha256sum dist/werss-cli-macos-universal.tar.gz | awk '{print $1}' > dist/werss-cli-macos-universal.tar.gz.sha256
47+
48+
- name: Upload Release Asset
49+
uses: softprops/action-gh-release@v2
50+
with:
51+
files: |
52+
dist/werss-cli-macos-universal.tar.gz
53+
dist/werss-cli-macos-universal.tar.gz.sha256
54+
generate_release_notes: true

0 commit comments

Comments
 (0)