|
| 1 | +name: Release Binaries |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + tag: |
| 10 | + description: 'Tag to release' |
| 11 | + required: true |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 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: 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 | + |
| 95 | + build-macos-aarch64: |
| 96 | + name: Build macOS aarch64 |
| 97 | + runs-on: macos-15 |
| 98 | + timeout-minutes: 60 |
| 99 | + steps: |
| 100 | + - name: Checkout Code |
| 101 | + uses: actions/checkout@v4 |
| 102 | + with: |
| 103 | + submodules: recursive |
| 104 | + - name: Setup Swift |
| 105 | + uses: SwiftyLab/setup-swift@latest |
| 106 | + - name: Setup Rust |
| 107 | + uses: dtolnay/rust-toolchain@nightly |
| 108 | + - name: Install Dependencies |
| 109 | + run: | |
| 110 | + brew install rocksdb openssl |
| 111 | + - name: Build External Libraries |
| 112 | + run: ./scripts/build-external-libs.sh |
| 113 | + - name: Build Dependencies |
| 114 | + run: make deps |
| 115 | + - name: Build Release Binary |
| 116 | + run: | |
| 117 | + 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 |
| 121 | + - name: Upload Binary |
| 122 | + uses: actions/upload-artifact@v4 |
| 123 | + with: |
| 124 | + name: boka-macos-aarch64 |
| 125 | + path: Boka/boka-macos-aarch64 |
| 126 | + retention-days: 7 |
| 127 | + |
| 128 | + create-release: |
| 129 | + name: Create GitHub Release |
| 130 | + needs: [build-linux-x64, build-macos-aarch64] |
| 131 | + runs-on: ubuntu-latest |
| 132 | + permissions: |
| 133 | + contents: write |
| 134 | + steps: |
| 135 | + - name: Checkout Code |
| 136 | + uses: actions/checkout@v4 |
| 137 | + - name: Download all artifacts |
| 138 | + uses: actions/download-artifact@v4 |
| 139 | + with: |
| 140 | + path: binaries |
| 141 | + - name: Create checksums |
| 142 | + run: | |
| 143 | + cd binaries |
| 144 | + find . -name "boka-*" -type f -exec sha256sum {} + > checksums-all.txt |
| 145 | + - name: Get release tag |
| 146 | + id: get_tag |
| 147 | + run: | |
| 148 | + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then |
| 149 | + echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT |
| 150 | + else |
| 151 | + echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT |
| 152 | + fi |
| 153 | + - name: Create Release |
| 154 | + uses: softprops/action-gh-release@v2 |
| 155 | + with: |
| 156 | + tag_name: ${{ steps.get_tag.outputs.tag }} |
| 157 | + name: "Boka ${{ steps.get_tag.outputs.tag }}" |
| 158 | + body: | |
| 159 | + ## Boka Binary Release ${{ steps.get_tag.outputs.tag }} |
| 160 | +
|
| 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) |
| 168 | +
|
| 169 | + ### Usage |
| 170 | + ```bash |
| 171 | + # Download and make executable |
| 172 | + chmod +x boka-* |
| 173 | +
|
| 174 | + # Run the binary |
| 175 | + ./boka-linux-x64 --help |
| 176 | + ./boka-macos-aarch64 generate --help |
| 177 | + ./boka-macos-aarch64 fuzz --help |
| 178 | + ``` |
| 179 | +
|
| 180 | + ### Verification |
| 181 | + Verify binary integrity using the provided checksums: |
| 182 | + ```bash |
| 183 | + sha256sum -c checksums-all.txt |
| 184 | + ``` |
| 185 | +
|
| 186 | + ### Docker Alternative |
| 187 | + If you prefer Docker: `docker run --rm acala/boka:latest --help` |
| 188 | + files: | |
| 189 | + binaries/boka-linux-x64/boka-linux-x64 |
| 190 | + binaries/boka-macos-aarch64/boka-macos-aarch64 |
| 191 | + binaries/checksums-all.txt |
| 192 | + draft: false |
| 193 | + prerelease: false |
| 194 | + env: |
| 195 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments