ci: update release process with release-please #58
This file contains 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: | |
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 | |
- name: Install target | |
run: rustup target add ${{ matrix.arch }} | |
- name: Install cross v0.2.4 from source | |
run: cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.4 | |
- 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" |