feat(noir_js): allow providing foreign call handlers in noirJS #436
Workflow file for this run
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: Rebuild ACIR artifacts | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
check-artifacts-requested: | |
name: Check if artifacts should be published | |
runs-on: ubuntu-22.04 | |
outputs: | |
publish: ${{ steps.check.outputs.publish }} | |
steps: | |
- name: Check if artifacts should be published | |
id: check | |
run: | | |
if [ ${{ github.ref_name }} == "master" ]; then | |
# Always publish on master | |
echo "publish=true" >> "$GITHUB_OUTPUT" | |
else | |
# Only publish on PRs if label is set | |
HAS_ARTIFACT_LABEL=$(gh pr view $PR --repo $REPO_URL --json labels | jq '.labels | any(.name == "publish-acir")') | |
echo "publish=$HAS_ARTIFACT_LABEL" >> "$GITHUB_OUTPUT" | |
fi | |
env: | |
GH_TOKEN: ${{ github.token }} | |
PR: ${{ github.event.pull_request.number }} | |
REPO_URL: ${{ github.repositoryUrl }} | |
build-nargo: | |
name: Build nargo binary | |
runs-on: ubuntu-22.04 | |
needs: [check-artifacts-requested] | |
if: ${{ needs.check-artifacts-requested.outputs.publish == true }} | |
strategy: | |
matrix: | |
target: [x86_64-unknown-linux-gnu] | |
steps: | |
- name: Checkout Noir repo | |
uses: actions/checkout@v4 | |
- name: Setup toolchain | |
uses: dtolnay/[email protected] | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.target }} | |
cache-on-failure: true | |
save-if: ${{ github.event_name != 'merge_group' }} | |
- name: Build Nargo | |
run: cargo build --package nargo_cli --release | |
- name: Package artifacts | |
run: | | |
mkdir dist | |
cp ./target/release/nargo ./dist/nargo | |
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: nargo | |
path: ./dist/* | |
retention-days: 3 | |
auto-pr-rebuild-script: | |
name: Rebuild ACIR artifacts | |
needs: [build-nargo] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Download nargo binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: nargo | |
path: ./nargo | |
- name: Add Nargo to $PATH | |
run: | | |
chmod +x ${{ github.workspace }}/nargo/nargo | |
echo "${{ github.workspace }}/nargo" >> $GITHUB_PATH | |
- name: Set up Git user (Github Action) | |
run: | | |
git config --local user.name kevaundray | |
git config --local user.email [email protected] | |
- name: Run rebuild script | |
working-directory: tooling/nargo_cli/tests | |
run: | | |
chmod +x ./rebuild.sh | |
./rebuild.sh | |
- name: Upload ACIR artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: acir-artifacts | |
path: ./tooling/nargo_cli/tests/acir_artifacts | |
retention-days: 10 | |
- name: Check for changes in acir_artifacts directory | |
id: check_changes | |
if: ${{ github.ref_name }} == "master" | |
run: | | |
git diff --quiet tooling/nargo_cli/tests/acir_artifacts/ || echo "::set-output name=changes::true" | |
- name: Create or Update PR | |
if: steps.check_changes.outputs.changes == 'true' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.NOIR_REPO_TOKEN }} | |
commit-message: "chore: update acir artifacts" | |
title: "chore: Update ACIR artifacts" | |
body: "Automatic PR to update acir artifacts" | |
add-paths: tooling/nargo_cli/tests/acir_artifacts/*.gz | |
labels: "auto-pr" | |
branch: "auto-pr-rebuild-script-branch" |