1- name : Release
1+ name : Release Binaries
22
33on :
44 push :
55 tags :
66 - v[0-9]+.*
7+ workflow_dispatch :
78
89permissions :
910 contents : write
1011
11- jobs :
12- create-release :
13- runs-on : ubuntu-latest
14- steps :
15- - uses : actions/checkout@master
16- - uses : taiki-e/create-gh-release-action@v1
17- with :
18- token : ${{ secrets.GITHUB_TOKEN }}
12+ env :
13+ CARGO_TERM_COLOR : always
1914
20- upload-assets :
21- name : ${{ matrix.target }}
22- needs :
23- - create-release
15+ jobs :
16+ build-and-release :
17+ runs-on : ${{ matrix.os }}
18+
2419 strategy :
2520 matrix :
26- os :
27- - ubuntu-latest
28- - macos-latest
29- runs-on : ${{ matrix.os }}
21+ os : [ubuntu-latest, macos-latest]
22+
23+ permissions :
24+ contents : write
25+ packages : read
26+
3027 steps :
31- - uses : actions/checkout@master
28+ - name : Checkout code
29+ uses : actions/checkout@v4
30+
31+ - name : Install Ziren toolchain
32+ run : curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | sh
33+
3234 # Install Go for all platforms (required for zkm-recursion-gnark-ffi)
3335 - name : Install Go (Ubuntu)
3436 if : matrix.os == 'ubuntu-latest'
@@ -40,30 +42,76 @@ jobs:
4042 uses : actions/setup-go@v5
4143 with :
4244 go-version : ' 1.21'
43- # Install protobuf-compiler for Ubuntu
44- - name : Install protobuf-compiler (Ubuntu)
45- if : matrix.os == 'ubuntu-latest'
45+
46+ - name : Install dependencies (Linux)
47+ if : runner.os == 'Linux'
48+ run : sudo apt-get update && sudo apt install protobuf-compiler -y
49+
50+ - name : Install dependencies (macOS)
51+ if : runner.os == 'macOS'
52+ run : brew install protobuf
53+
54+ - name : Extract version from tag
55+ id : version
4656 run : |
47- sudo apt-get update
48- sudo apt-get install -y protobuf-compiler
49- # Install protobuf-compiler for macOS
50- - name : Install protobuf-compiler (macOS)
51- if : matrix.os == 'macos-latest'
57+ VERSION=${GITHUB_REF#refs/tags/}
58+ echo "VERSION=$VERSION" >> $GITHUB_ENV
59+ echo "Version: $VERSION"
60+
61+ - name : Build all binaries in release mode
62+ run : source ~/.zkm-toolchain/env && cargo build -r --workspace
63+
64+ - name : Create release artifacts directory
65+ run : mkdir -p release-artifacts
66+
67+ - name : Collect binaries
5268 run : |
53- brew install protobuf
54- # Install Rust nightly toolchain
55- - uses : actions-rs/toolchain@v1
56- with :
57- toolchain : nightly
58- override : true
59- - uses : taiki-e/upload-rust-binary-action@v1
69+ BINS=(
70+ "target/release/noded"
71+ "target/release/sequencer-set-publish"
72+ "target/release/send-challenge"
73+ "target/release/send-rbf"
74+ "target/release/send-pegin-request"
75+ "target/release/send-pegout"
76+ "target/release/db-inject"
77+ )
78+
79+ if [ "${{ runner.os }}" = "Linux" ]; then
80+ PLATFORM="x86_64-linux"
81+ CHECKSUM_CMD="sha256sum"
82+ else
83+ PLATFORM="x86_64-macos"
84+ CHECKSUM_CMD="shasum -a 256"
85+ fi
86+
87+ for bin in "${BINS[@]}"; do
88+ if [ -f "$bin" ]; then
89+ BASENAME=$(basename "$bin")
90+ ARCHIVE="release-artifacts/${BASENAME}-${{ env.VERSION }}-${PLATFORM}"
91+ cp "$bin" "$ARCHIVE"
92+ chmod +x "$ARCHIVE"
93+ $CHECKSUM_CMD "$ARCHIVE" > "${ARCHIVE}.sha256"
94+ echo "✓ $BASENAME"
95+ fi
96+ done
97+
98+ echo "Artifacts created:"
99+ ls -lh release-artifacts/
100+
101+ - name : Create GitHub Release
102+ uses : softprops/action-gh-release@v1
60103 with :
61- # (required)
62- bin : bitvm2-noded
63- archive : $bin-$target
64- target : ${{ matrix.target }}
65- tar : all
104+ files : release-artifacts/*
105+ draft : false
106+ prerelease : ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
107+ token : ${{ secrets.GITHUB_TOKEN }}
66108 env :
67- # (required)
68- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
69- CARGO_PROFILE_RELEASE_LTO : true
109+ GITHUB_REPOSITORY : ${{ github.repository }}
110+
111+ - name : Upload to Releases summary
112+ run : |
113+ echo "## 📦 Released Binaries (${{ runner.os }})" >> $GITHUB_STEP_SUMMARY
114+ echo "" >> $GITHUB_STEP_SUMMARY
115+ echo "### Version: ${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY
116+ echo "" >> $GITHUB_STEP_SUMMARY
117+ ls -1 release-artifacts/ | sed 's/^/- /' >> $GITHUB_STEP_SUMMARY
0 commit comments