Skip to content

ci: update release process with release-please #60

ci: update release process with release-please

ci: update release process with release-please #60

Workflow file for this run

name: Release binaries
on:
workflow_call:
inputs:
tag:
type: string
description: 'The tag to use for the Docker image'
required: true
pull_request:
jobs:
build:
name: Build binaries
strategy:
matrix:
include:
- arch: x86_64-unknown-linux-gnu
platform: ubuntu-24.04
- arch: aarch64-unknown-linux-gnu
platform: ubuntu-24.04
- arch: x86_64-apple-darwin
platform: macos-latest
- arch: aarch64-apple-darwin
platform: macos-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || '' }}
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
rustflags: ""
- name: Install target
run: rustup target add ${{ matrix.arch }}
- name: Install cross v0.2.5 from source
run: cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.5
- name: Build anvil-zksync for ${{ matrix.arch }}
run: |
[[ "${{ matrix.arch }}" == *"linux"* ]] && make build-static-${{ matrix.arch }} || make build-${{ matrix.arch }}
- name: Pack anvil-zksync
run: |
tar -czf anvil-zksync-${{ inputs.tag || 'v0.0.0' }}-${{ matrix.arch }}.tar.gz \
./target/${{ matrix.arch }}/release/anvil-zksync
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: anvil-zksync-${{ matrix.arch }}
path: anvil-zksync-${{ inputs.tag || 'v0.0.0' }}-${{ matrix.arch }}.tar.gz
upload-binaries:
name: Upload binaries
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || '' }}
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: "anvil-zksync-*"
path: artifacts
- name: Unpack artifacts
shell: 'bash -ex {0}'
run: |
find ./artifacts
# - name: Binaries attestation
# uses: actions/attest-build-provenance@v2
# with:
# subject-path: ./artifacts/anvil-zksync
# - name: Create release draft
# env:
# GITHUB_USER: ${{ github.repository_owner }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# assets=()
# for asset in ./anvil-zksync-*.tar.gz*; do
# assets+=("$asset/$asset")
# done
# tag_name="${{ env.VERSION }}"
# gh release create "$tag_name" "${assets[@]}" --draft -F "-" -t "Release: $tag_name"