|
| 1 | +name: zkevm-sdk-build |
| 2 | + |
| 3 | +# Builds the redistributable `zkevm-sdk-<version>.tar.gz` artifact. |
| 4 | +# Contents (host-independent — `libzkevm.a` is always built for |
| 5 | +# `riscv64im-succinct-zkvm-elf`): |
| 6 | +# |
| 7 | +# zkevm-sdk-<version>/ |
| 8 | +# ├── libzkevm.a |
| 9 | +# ├── zkvm.ld |
| 10 | +# ├── include/zkvm_accelerators.h |
| 11 | +# └── README.md |
| 12 | +# |
| 13 | +# Triggers: |
| 14 | +# - workflow_dispatch: manual sanity-check build. Uploads the tarball |
| 15 | +# as a workflow artifact (downloadable from the Actions UI). |
| 16 | +# - workflow_call: invoked from `release.yml` as part of the SP1 |
| 17 | +# release process. With `release_tag` set, the tarball is |
| 18 | +# `gh release upload`-ed to that tag instead of being kept as a |
| 19 | +# workflow artifact. |
| 20 | + |
| 21 | +on: |
| 22 | + workflow_dispatch: |
| 23 | + inputs: |
| 24 | + version: |
| 25 | + description: 'SDK version (used in the tarball filename, e.g. v6.2.0 or 0.1.0-pre)' |
| 26 | + required: true |
| 27 | + default: '0.1.0-pre' |
| 28 | + workflow_call: |
| 29 | + inputs: |
| 30 | + version: |
| 31 | + description: 'SDK version (used in the tarball filename)' |
| 32 | + type: string |
| 33 | + required: true |
| 34 | + release_tag: |
| 35 | + description: 'If non-empty, gh release upload the tarball to this tag instead of saving a workflow artifact' |
| 36 | + type: string |
| 37 | + default: '' |
| 38 | + dry_run: |
| 39 | + description: 'Dry run - build but skip the release upload' |
| 40 | + type: boolean |
| 41 | + default: false |
| 42 | + |
| 43 | +jobs: |
| 44 | + build: |
| 45 | + runs-on: [runs-on, runner=8cpu-linux-x64, "run-id=${{ github.run_id }}"] |
| 46 | + timeout-minutes: 60 |
| 47 | + steps: |
| 48 | + - name: Checkout |
| 49 | + uses: actions/checkout@v6 |
| 50 | + |
| 51 | + - name: Setup CI |
| 52 | + uses: ./.github/actions/setup |
| 53 | + |
| 54 | + - name: Install SP1 toolchain (succinct) |
| 55 | + run: cargo run -p sp1-cli --no-default-features -- prove install-toolchain |
| 56 | + |
| 57 | + - name: Build SDK archive |
| 58 | + run: make -C zkevm sdk-archive SDK_VERSION=${{ inputs.version }} |
| 59 | + |
| 60 | + - name: Upload tarball as workflow artifact |
| 61 | + if: ${{ inputs.release_tag == '' }} |
| 62 | + uses: actions/upload-artifact@v4 |
| 63 | + with: |
| 64 | + name: zkevm-sdk-${{ inputs.version }} |
| 65 | + path: zkevm/zkevm-sdk-${{ inputs.version }}.tar.gz |
| 66 | + retention-days: 30 |
| 67 | + |
| 68 | + - name: Upload tarball to release |
| 69 | + if: ${{ inputs.release_tag != '' && inputs.dry_run != true }} |
| 70 | + env: |
| 71 | + GH_TOKEN: ${{ secrets.SP1_RELEASE_TOKEN }} |
| 72 | + run: | |
| 73 | + gh release upload "${{ inputs.release_tag }}" "zkevm/zkevm-sdk-${{ inputs.version }}.tar.gz" |
0 commit comments