Build and release(manual) #71
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: Build and release(manual) | |
on: | |
workflow_dispatch: | |
inputs: | |
commit: | |
type: string | |
description: SHA commit for build | |
required: false | |
prefix: | |
type: string | |
description: Prefix for release name | |
required: false | |
default: manual | |
jobs: | |
build-contracts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.commit }} | |
submodules: recursive | |
- name: Install foundry-zksync | |
run: | | |
mkdir ./foundry-zksync | |
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz | |
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync | |
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast | |
echo "$PWD/foundry-zksync" >> $GITHUB_PATH | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.18.0 | |
cache: yarn | |
- name: Init | |
id: init | |
run: | | |
yarn | |
echo "release_tag=${{ inputs.prefix }}-${{ inputs.commit }}" >> $GITHUB_OUTPUT | |
- name: Build l1 contracts | |
working-directory: l1-contracts | |
run: | | |
forge build | |
- name: Build l2 contracts | |
working-directory: l2-contracts | |
run: | | |
forge build --zksync --zk-enable-eravm-extensions | |
- name: Build system-contracts | |
working-directory: system-contracts | |
run: | | |
yarn install | |
yarn preprocess:system-contracts | |
forge build --zksync --zk-enable-eravm-extensions | |
yarn preprocess:bootloader | |
forge build --zksync --zk-enable-eravm-extensions | |
- name: Prepare artifacts | |
run: | | |
tar -czvf l1-contracts.tar.gz ./l1-contracts | |
tar -czvf l2-contracts.tar.gz ./l2-contracts | |
tar -czvf system-contracts.tar.gz ./system-contracts | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.init.outputs.release_tag }} | |
fail_on_unmatched_files: true | |
target_commitish: ${{ inputs.commit }} | |
body: "" | |
files: | | |
l1-contracts.tar.gz | |
l2-contracts.tar.gz | |
system-contracts.tar.gz |