From f6498719f408bded087d68b11ec537a56e58b3d7 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Thu, 21 Sep 2023 19:46:48 +0100 Subject: [PATCH] chore: Automatically update acir artifacts (#2454) Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com> Co-authored-by: Tom French --- .github/workflows/auto-pr-rebuild-script.yml | 82 ++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/auto-pr-rebuild-script.yml diff --git a/.github/workflows/auto-pr-rebuild-script.yml b/.github/workflows/auto-pr-rebuild-script.yml new file mode 100644 index 00000000000..e0d59d28f4c --- /dev/null +++ b/.github/workflows/auto-pr-rebuild-script.yml @@ -0,0 +1,82 @@ +name: Automatically rebuild ACIR artifacts + +on: + push: + branches: + - master + +jobs: + build-nargo: + runs-on: ubuntu-22.04 + strategy: + matrix: + target: [x86_64-unknown-linux-gnu] + + steps: + - name: Checkout Noir repo + uses: actions/checkout@v4 + + - name: Setup toolchain + uses: dtolnay/rust-toolchain@1.66.0 + + - 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: + 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.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Run rebuild script + working-directory: tooling/nargo_cli/tests + run: | + chmod +x ./rebuild.sh + ./rebuild.sh + + - name: Create or Update PR + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "chore: update acir artifacts" + title: "chore: Update ACIR artifacts" + body: "Automatic PR to update acir artifacts" + labels: "auto-pr" + branch: "auto-pr-rebuild-script-branch"