fix: release binary #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Binaries | |
| on: | |
| push: | |
| tags: | |
| - v[0-9]+.* | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-and-release: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| permissions: | |
| contents: write | |
| packages: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Ziren toolchain | |
| run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | sh | |
| # Install Go for all platforms (required for zkm-recursion-gnark-ffi) | |
| - name: Install Go (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Install Go (macOS) | |
| if: matrix.os == 'macos-latest' | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Install dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt install protobuf-compiler -y | |
| - name: Install dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install protobuf | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "Version: $VERSION" | |
| - name: Build all binaries in release mode | |
| run: source ~/.zkm-toolchain/env && cargo build -r --workspace | |
| - name: Create release artifacts directory | |
| run: mkdir -p release-artifacts | |
| - name: Collect binaries | |
| run: | | |
| BINS=( | |
| "target/release/noded" | |
| "target/release/sequencer-set-publish" | |
| "target/release/send-challenge" | |
| "target/release/send-rbf" | |
| "target/release/send-pegin-request" | |
| "target/release/send-pegout" | |
| "target/release/db-inject" | |
| ) | |
| if [ "${{ runner.os }}" = "Linux" ]; then | |
| PLATFORM="x86_64-linux" | |
| CHECKSUM_CMD="sha256sum" | |
| else | |
| PLATFORM="x86_64-macos" | |
| CHECKSUM_CMD="shasum -a 256" | |
| fi | |
| for bin in "${BINS[@]}"; do | |
| if [ -f "$bin" ]; then | |
| BASENAME=$(basename "$bin") | |
| ARCHIVE="release-artifacts/${BASENAME}-${{ env.VERSION }}-${PLATFORM}" | |
| cp "$bin" "$ARCHIVE" | |
| chmod +x "$ARCHIVE" | |
| $CHECKSUM_CMD "$ARCHIVE" > "${ARCHIVE}.sha256" | |
| echo "✓ $BASENAME" | |
| fi | |
| done | |
| echo "Artifacts created:" | |
| ls -lh release-artifacts/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: release-artifacts/* | |
| draft: false | |
| prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| env: | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| - name: Upload to Releases summary | |
| run: | | |
| echo "## 📦 Released Binaries (${{ runner.os }})" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Version: ${{ env.VERSION }}" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| ls -1 release-artifacts/ | sed 's/^/- /' >> $GITHUB_STEP_SUMMARY |