Skip to content

Fuzz tests update (#377) #3

Fuzz tests update (#377)

Fuzz tests update (#377) #3

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-macos-aarch64:
name: Build macOS aarch64
runs-on: macos-15
timeout-minutes: 60
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Swift
uses: SwiftyLab/setup-swift@latest
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
- name: Install Dependencies
run: |
brew install openssl snappy
- name: Build External Libraries
run: ./scripts/build-external-libs.sh
- name: Build Dependencies
run: make deps
- name: Build Release Binary
run: |
cd Boka
export MACOSX_DEPLOYMENT_TARGET=15.0
# Create a local build directory for static libraries
mkdir -p ../static-libs
STATIC_LIB_DIR="$(pwd)/../static-libs"
cd ../static-libs
# Build LZ4 static from source
git clone --depth=1 https://github.com/lz4/lz4.git
cd lz4/lib
make clean
make liblz4.a
mkdir -p "$STATIC_LIB_DIR/lib" "$STATIC_LIB_DIR/include"
cp liblz4.a "$STATIC_LIB_DIR/lib/"
cp lz4.h lz4hc.h lz4frame.h "$STATIC_LIB_DIR/include/"
cd ../..
# Build Zstd static from source
git clone --depth=1 https://github.com/facebook/zstd.git
cd zstd/lib
make clean
make libzstd.a
mkdir -p "$STATIC_LIB_DIR/lib" "$STATIC_LIB_DIR/include"
cp libzstd.a "$STATIC_LIB_DIR/lib/"
cp zstd.h zdict.h zstd_errors.h "$STATIC_LIB_DIR/include/"
cd ../..
# Build RocksDB static with our static compression libs
git clone --depth=1 https://github.com/facebook/rocksdb.git
cd rocksdb
make clean
PORTABLE=1 make static_lib \
LDFLAGS="-L$STATIC_LIB_DIR/lib" \
EXTRA_CXXFLAGS="-I$STATIC_LIB_DIR/include -Wno-unused-parameter" \
USE_RTTI=1
cp librocksdb.a "$STATIC_LIB_DIR/lib/"
cp -r include/rocksdb "$STATIC_LIB_DIR/include/"
cd ../../Boka
# Build Swift release binary with our static libraries
swift build -c release \
-Xlinker "$STATIC_LIB_DIR/lib/librocksdb.a" \
-Xlinker "$STATIC_LIB_DIR/lib/liblz4.a" \
-Xlinker "$STATIC_LIB_DIR/lib/libzstd.a" \
-Xlinker $(brew --prefix snappy)/lib/libsnappy.a \
-Xlinker $(brew --prefix openssl)/lib/libssl.a \
-Xlinker $(brew --prefix openssl)/lib/libcrypto.a \
-Xlinker -lc++ \
-Xlinker -lz \
-Xlinker -lbz2
cp $(swift build -c release --show-bin-path)/Boka ../boka-macos-aarch64
strip ../boka-macos-aarch64
# Verify dependencies
otool -L ../boka-macos-aarch64
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: boka-macos-aarch64
path: ./boka-macos-aarch64
retention-days: 7
create-release:
name: Create GitHub Release
needs: [build-macos-aarch64]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: binaries
- name: Create checksums
run: |
cd binaries
find . -name "boka-*" -type f -exec sha256sum {} + > checksums-all.txt
- name: Get release tag
id: get_tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_tag.outputs.tag }}
name: "Boka ${{ steps.get_tag.outputs.tag }}"
body: |
## Boka Binary Release ${{ steps.get_tag.outputs.tag }}
Download binaries for your platform:
### Usage
```bash
# macOS: Download and make executable
chmod +x boka-macos-aarch64
./boka-macos-aarch64 --help
# Linux: Use Docker
docker run --rm acala/boka:${{ steps.get_tag.outputs.tag }} fuzz target --help
```
### Verification
Verify macOS binary integrity:
```bash
sha256sum -c checksums-all.txt
```
files: |
binaries/boka-macos-aarch64/boka-macos-aarch64
binaries/checksums-all.txt
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}