1- name : Release Binaries
1+ name : Release
22
33on :
44 push :
@@ -15,83 +15,6 @@ concurrency:
1515 cancel-in-progress : true
1616
1717jobs :
18- build-linux-x64 :
19- name : Build Linux x64
20- runs-on : [self-hosted, linux]
21- timeout-minutes : 60
22- steps :
23- - name : Checkout Code
24- uses : actions/checkout@v4
25- with :
26- submodules : recursive
27- - run : sudo apt-get update
28- - uses : awalsh128/cache-apt-pkgs-action@latest
29- with :
30- packages : curl build-essential cmake librocksdb-dev libzstd-dev libbz2-dev liblz4-dev
31- - uses : aws-actions/configure-aws-credentials@v4
32- with :
33- aws-region : us-east-2
34- - name : Cache SPM
35- uses : runs-on/cache@v4
36- with :
37- path : ' **/.build'
38- key : ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
39- restore-keys : |
40- ${{ runner.os }}-spm-
41- env :
42- RUNS_ON_S3_BUCKET_CACHE : laminar-gh-action-cache
43- - name : Cache Cargo
44- uses : actions/cache@v4
45- with :
46- path : |
47- ~/.cargo/bin/
48- ~/.cargo/registry/index/
49- ~/.cargo/registry/cache/
50- ~/.cargo/git/db/
51- target/
52- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
53- - name : Cache bandersnatch_vrfs static lib
54- uses : actions/cache@v4
55- with :
56- path : .lib/libbandersnatch_vrfs.a
57- key : ${{ runner.os }}-libs-libbandersnatch-${{ hashFiles('Utils/Sources/bandersnatch/**') }}
58- restore-keys : |
59- ${{ runner.os }}-libs-libbandersnatch
60- - name : Cache bls static lib
61- uses : actions/cache@v4
62- with :
63- path : .lib/libbls.a
64- key : ${{ runner.os }}-libs-libbls-${{ hashFiles('Utils/Sources/bls/**') }}
65- restore-keys : |
66- ${{ runner.os }}-libs-libbls
67- - name : Cache erasure-coding static lib
68- uses : actions/cache@v4
69- with :
70- path : .lib/libec.a
71- key : ${{ runner.os }}-libs-libec-${{ hashFiles('Utils/Sources/erasure-coding/**') }}
72- restore-keys : |
73- ${{ runner.os }}-libs-libec
74- - name : Setup Swift
75- uses : SwiftyLab/setup-swift@latest
76- - name : Setup Rust
77- uses : dtolnay/rust-toolchain@nightly
78- - name : Build External Libraries
79- run : ./scripts/build-external-libs.sh
80- - name : Build Dependencies
81- run : make deps
82- - name : Build Release Binary
83- run : |
84- cd Boka
85- swift build -c release
86- cp $(swift build -c release --show-bin-path)/Boka boka-linux-x64
87- strip boka-linux-x64
88- - name : Upload Binary
89- uses : actions/upload-artifact@v4
90- with :
91- name : boka-linux-x64
92- path : Boka/boka-linux-x64
93- retention-days : 7
94-
9518 build-macos-aarch64 :
9619 name : Build macOS aarch64
9720 runs-on : macos-15
@@ -107,27 +30,79 @@ jobs:
10730 uses : dtolnay/rust-toolchain@nightly
10831 - name : Install Dependencies
10932 run : |
110- brew install rocksdb openssl
33+ brew install openssl snappy
11134 - name : Build External Libraries
11235 run : ./scripts/build-external-libs.sh
11336 - name : Build Dependencies
11437 run : make deps
11538 - name : Build Release Binary
11639 run : |
11740 cd Boka
118- swift build -c release
119- cp $(swift build -c release --show-bin-path)/Boka boka-macos-aarch64
120- strip boka-macos-aarch64
41+ export MACOSX_DEPLOYMENT_TARGET=15.0
42+
43+ # Create a local build directory for static libraries
44+ mkdir -p ../static-libs
45+ STATIC_LIB_DIR="$(pwd)/../static-libs"
46+ cd ../static-libs
47+
48+ # Build LZ4 static from source
49+ git clone --depth=1 https://github.com/lz4/lz4.git
50+ cd lz4/lib
51+ make clean
52+ make liblz4.a
53+ mkdir -p "$STATIC_LIB_DIR/lib" "$STATIC_LIB_DIR/include"
54+ cp liblz4.a "$STATIC_LIB_DIR/lib/"
55+ cp lz4.h lz4hc.h lz4frame.h "$STATIC_LIB_DIR/include/"
56+ cd ../..
57+
58+ # Build Zstd static from source
59+ git clone --depth=1 https://github.com/facebook/zstd.git
60+ cd zstd/lib
61+ make clean
62+ make libzstd.a
63+ mkdir -p "$STATIC_LIB_DIR/lib" "$STATIC_LIB_DIR/include"
64+ cp libzstd.a "$STATIC_LIB_DIR/lib/"
65+ cp zstd.h zdict.h zstd_errors.h "$STATIC_LIB_DIR/include/"
66+ cd ../..
67+
68+ # Build RocksDB static with our static compression libs
69+ git clone --depth=1 https://github.com/facebook/rocksdb.git
70+ cd rocksdb
71+ make clean
72+ PORTABLE=1 make static_lib \
73+ LDFLAGS="-L$STATIC_LIB_DIR/lib" \
74+ EXTRA_CXXFLAGS="-I$STATIC_LIB_DIR/include -Wno-unused-parameter" \
75+ USE_RTTI=1
76+ cp librocksdb.a "$STATIC_LIB_DIR/lib/"
77+ cp -r include/rocksdb "$STATIC_LIB_DIR/include/"
78+ cd ../../Boka
79+
80+ # Build Swift release binary with our static libraries
81+ swift build -c release \
82+ -Xlinker "$STATIC_LIB_DIR/lib/librocksdb.a" \
83+ -Xlinker "$STATIC_LIB_DIR/lib/liblz4.a" \
84+ -Xlinker "$STATIC_LIB_DIR/lib/libzstd.a" \
85+ -Xlinker $(brew --prefix snappy)/lib/libsnappy.a \
86+ -Xlinker $(brew --prefix openssl)/lib/libssl.a \
87+ -Xlinker $(brew --prefix openssl)/lib/libcrypto.a \
88+ -Xlinker -lc++ \
89+ -Xlinker -lz \
90+ -Xlinker -lbz2
91+ cp $(swift build -c release --show-bin-path)/Boka ../boka-macos-aarch64
92+ strip ../boka-macos-aarch64
93+
94+ # Verify dependencies
95+ otool -L ../boka-macos-aarch64
12196 - name : Upload Binary
12297 uses : actions/upload-artifact@v4
12398 with :
12499 name : boka-macos-aarch64
125- path : Boka /boka-macos-aarch64
100+ path : . /boka-macos-aarch64
126101 retention-days : 7
127102
128103 create-release :
129104 name : Create GitHub Release
130- needs : [build-linux-x64, build- macos-aarch64]
105+ needs : [build-macos-aarch64]
131106 runs-on : ubuntu-latest
132107 permissions :
133108 contents : write
@@ -158,35 +133,24 @@ jobs:
158133 body : |
159134 ## Boka Binary Release ${{ steps.get_tag.outputs.tag }}
160135
161- Standalone binaries for multiple platforms. Download the appropriate binary for your system:
162-
163- ### Linux
164- - **x64**: `boka-linux-x64` - For Intel/AMD 64-bit Linux systems
165-
166- ### macOS
167- - **aarch64**: `boka-macos-aarch64` - For Apple Silicon Macs (M1/M2/M3)
136+ Download binaries for your platform:
168137
169138 ### Usage
170139 ```bash
171- # Download and make executable
172- chmod +x boka-*
140+ # macOS: Download and make executable
141+ chmod +x boka-macos-aarch64
142+ ./boka-macos-aarch64 --help
173143
174- # Run the binary
175- ./boka-linux-x64 --help
176- ./boka-macos-aarch64 generate --help
177- ./boka-macos-aarch64 fuzz --help
144+ # Linux: Use Docker
145+ docker run --rm acala/boka:${{ steps.get_tag.outputs.tag }} fuzz target --help
178146 ```
179147
180148 ### Verification
181- Verify binary integrity using the provided checksums :
149+ Verify macOS binary integrity:
182150 ```bash
183151 sha256sum -c checksums-all.txt
184152 ```
185-
186- ### Docker Alternative
187- If you prefer Docker: `docker run --rm acala/boka:latest --help`
188153 files : |
189- binaries/boka-linux-x64/boka-linux-x64
190154 binaries/boka-macos-aarch64/boka-macos-aarch64
191155 binaries/checksums-all.txt
192156 draft : false
0 commit comments