Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into kw/no-backend-hack
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Oct 31, 2023
2 parents 24ec71f + f502108 commit 324a83f
Show file tree
Hide file tree
Showing 532 changed files with 3,134 additions and 2,299 deletions.
40 changes: 39 additions & 1 deletion .github/workflows/auto-pr-rebuild-script.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,41 @@
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
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { REF_NAME } = process.env;
if (REF_NAME == "master") {
return true;
}
const labels = context.payload.pull_request.labels.map(label => label.name);
return labels.includes('publish-acir');
result-encoding: string
env:
REF_NAME: ${{ github.ref_name }}

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]
Expand All @@ -17,7 +45,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
uses: dtolnay/rust-toolchain@1.71.1

- uses: Swatinem/rust-cache@v2
with:
Expand All @@ -42,6 +70,7 @@ jobs:
retention-days: 3

auto-pr-rebuild-script:
name: Rebuild ACIR artifacts
needs: [build-nargo]
runs-on: ubuntu-latest

Expand Down Expand Up @@ -71,10 +100,19 @@ jobs:
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'
Expand Down
109 changes: 27 additions & 82 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: Build docs

on:
pull_request:
paths:
- 'docs/**'
types:
- opened
- synchronize
- labeled

jobs:
add_label:
Expand Down Expand Up @@ -53,7 +47,7 @@ jobs:
})
}
deploy_docs:
build_and_deploy:
runs-on: ubuntu-latest
permissions:
pull-requests: write
Expand All @@ -62,81 +56,32 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Netlify deploy
run: |
BRANCH_NAME=$(echo "${{ github.head_ref || github.ref }}" | sed -e "s#refs/[^/]*/##")
curl -X POST -d {} "https://api.netlify.com/build_hooks/${{ secrets.NETLIFY_BUILD_HOOK }}?trigger_branch=$BRANCH_NAME"
- name: Get deploy preview
id: get_deploy_preview
run: |
BRANCH_NAME=$(echo "${{ github.head_ref || github.ref }}" | sed -e "s#refs/[^/]*/##")
curl -X GET "https://api.netlify.com/api/v1/sites/${{ secrets.NETLIFY_SITE_ID }}/deploys?branch=$BRANCH_NAME" > deploy.json
echo "::set-output name=deploy_url::$(cat deploy.json | jq -r '.[0].deploy_ssl_url')"
- name: Add PR Comment
uses: mshick/add-pr-comment@v2
with:
message: |
Hey @${{ github.event.pull_request.user.login }}! 🙌
I'm the deployment bot for Noir Docs, and I've got some updates for you:
## Deployment Status
Your latest changes are being deployed for preview! 🚀
Click the badge to see logs 🧐
[![Netlify Status](https://api.netlify.com/api/v1/badges/${{ secrets.NETLIFY_SITE_ID }}/deploy-status?branch=${{ github.head_ref || github.ref }})](https://app.netlify.com/sites/noir-docs-v2/deploys)
If you have any questions about this process, refer to our contribution guide or feel free to ask around.
- name: Check on deploy status
uses: ./.github/actions/docs/build-status
id: check_deploy_status
with:
branch-name: ${{ github.head_ref || github.ref }}
site-id: ${{ secrets.NETLIFY_SITE_ID }}
continue-on-error: true


- name: Debugging - print deploy_status
run: echo "${{ steps.check_deploy_status.outputs.deploy_status }}"


- name: Change PR Comment for Successful Deployment
if: steps.check_deploy_status.outputs.deploy_status == 'success'
uses: mshick/add-pr-comment@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
message-success: |
![It's Alive!](https://i.imgflip.com/82hw5n.jpg)
I'm a bot, beep boop 🤖
## Deployment Status: Success!
[![Netlify Status](https://api.netlify.com/api/v1/badges/${{ secrets.NETLIFY_SITE_ID }}/deploy-status?branch=${{ github.head_ref || github.ref }})](https://app.netlify.com/sites/noir-docs-v2/deploys)
## Preview
🌐 [View Deployment Preview](${{ steps.get_deploy_preview.outputs.deploy_url }})
node-version: '18'

- name: Change PR Comment for Failed Deployment
if: steps.check_deploy_status.outputs.deploy_status == 'failure'
uses: mshick/add-pr-comment@v2
- name: Install dependencies
run: yarn

- name: Build docs
run: yarn workspace docs build

- name: Remove pre-releases
working-directory: docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn setStable

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2.1
with:
message: |
![docs CI troll](https://i.imgflip.com/82ht8f.jpg)
I'm a bot, beep boop 🤖
## Deployment Status: Failed ❌
Deployment didn't succeed. Please check logs below and resolve the issue 🧐
[![Netlify Status](https://api.netlify.com/api/v1/badges/${{ secrets.NETLIFY_SITE_ID }}/deploy-status?branch=${{ github.head_ref || github.ref }})](https://app.netlify.com/sites/noir-docs-v2/deploys)
- name: Fail the workflow if deployment failed
if: steps.check_deploy_status.outputs.deploy_status == 'failure'
run: exit 1
publish-dir: './docs/build'
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-github-deployment: false
deploy-message: "Deploy from GitHub Actions for PR ${{ github.event.number }}"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
uses: dtolnay/rust-toolchain@1.71.1
with:
targets: ${{ matrix.target }}
components: clippy, rustfmt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gates_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
uses: dtolnay/rust-toolchain@1.71.1

- uses: Swatinem/rust-cache@v2
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/publish-acvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ jobs:
ref: ${{ inputs.acvm-ref }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.66.0
uses: dtolnay/rust-toolchain@1.71.1

# These steps are in a specific order so crate dependencies are updated first
- name: Publish acir_field
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish Docs

on:
workflow_dispatch:
inputs:
tag:
description: The tag to build Docs for
required: false

jobs:
publish-docs:
runs-on: ubuntu-latest
if: ${{ inputs.tag != '' }}
permissions:
pull-requests: write
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install Yarn
run: npm install -g yarn

- name: Install Yarn dependencies
run: yarn

- name: Cut a new version
working-directory: ./docs
run: yarn docusaurus docs:version ${{ inputs.tag }}

- name: Remove pre-releases
id: get_version
run: |
cd docs && yarn setStable
- name: Build docs
run: yarn workspace docs build

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2.1
with:
publish-dir: './docs/build'
production-branch: master
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-github-deployment: false
deploy-message: "Deploy from GitHub Actions for tag ${{ inputs.tag }}"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
7 changes: 4 additions & 3 deletions .github/workflows/publish-nargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx$(sw_vers -productVersion) --show-sdk-platform-version)" >> $GITHUB_ENV
- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
uses: dtolnay/rust-toolchain@1.71.1
with:
targets: ${{ matrix.target }}

Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
ref: ${{ inputs.tag || env.GITHUB_REF }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0
uses: dtolnay/rust-toolchain@1.71.1
with:
targets: ${{ matrix.target }}

Expand Down Expand Up @@ -177,6 +177,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./nargo-${{ matrix.target }}.tar.gz
asset_name: nargo-${{ matrix.target }}.tar.gz
prerelease: true
overwrite: true
tag: ${{ inputs.tag || 'nightly' }} # This will fail if `inputs.tag` is not a tag (e.g. testing a branch)

Expand All @@ -198,4 +199,4 @@ jobs:
overwrite: true
tag: ${{ format('{0}-{1}', 'nightly', steps.date.outputs.date) }}



22 changes: 22 additions & 0 deletions .github/workflows/recrawler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Algolia Recrawl
on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
algolia_recrawl:
name: Algolia Recrawl
runs-on: ubuntu-latest
steps:
- name: Algolia crawler creation and crawl
uses: algolia/algoliasearch-crawler-github-actions@v1.1.0
id: algolia_crawler
with:
crawler-user-id: ${{ secrets.CRAWLER_USER_ID }}
crawler-api-key: ${{ secrets.CRAWLER_API_KEY }}
algolia-app-id: ${{ secrets.ALGOLIA_APP_ID }}
algolia-api-key: ${{ secrets.ALGOLIA_API_KEY }}
site-url: 'https://noir-lang.org/'
crawler-name: noir-lang
override-config: false
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,20 @@ jobs:
workflow: publish-es-packages.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}", "npm-tag": "latest" }'
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}", "npm-tag": "latest" }'


publish-docs:
name: Publish docs
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Dispatch to publish workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-docs.yml
repo: noir-lang/noir
ref: master
token: ${{ secrets.GITHUB_TOKEN }}
inputs: '{ "tag": "${{ needs.release-please.outputs.tag-name }}"}'
Loading

0 comments on commit 324a83f

Please sign in to comment.