From 5a8f88faa15471fe5729b0ebbdc267cd09e078cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Tue, 7 Nov 2023 15:52:08 +0000 Subject: [PATCH] chore: creating a workflow for the release trigger (#3455) Co-authored-by: Savio <72797635+Savio-Sou@users.noreply.github.com> --- ...{publish-docs.yml => docs-new-version.yml} | 3 +- .../workflows/{build-docs.yml => docs-pr.yml} | 4 +- .github/workflows/docs-release.yml | 71 +++++++++++++++++++ .github/workflows/release.yml | 2 +- 4 files changed, 75 insertions(+), 5 deletions(-) rename .github/workflows/{publish-docs.yml => docs-new-version.yml} (98%) rename .github/workflows/{build-docs.yml => docs-pr.yml} (98%) create mode 100644 .github/workflows/docs-release.yml diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/docs-new-version.yml similarity index 98% rename from .github/workflows/publish-docs.yml rename to .github/workflows/docs-new-version.yml index b1dfd79fe70..9b109e170bb 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/docs-new-version.yml @@ -1,4 +1,4 @@ -name: Publish Docs +name: Cut a new version of the docs on: workflow_dispatch: @@ -90,7 +90,6 @@ jobs: --body "Updates documentation to new version for tag ${{ github.event.inputs.tag }}." \ --base master \ --head new-docs-version-${{ github.event.inputs.tag }} \ - --label documentation env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-docs.yml b/.github/workflows/docs-pr.yml similarity index 98% rename from .github/workflows/build-docs.yml rename to .github/workflows/docs-pr.yml index 11c2bd89a8d..d49b28e41e8 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/docs-pr.yml @@ -1,4 +1,4 @@ -name: Build docs +name: Deploy preview for PR on: pull_request: @@ -47,7 +47,7 @@ jobs: }) } - build_and_deploy: + build_and_deploy_preview: runs-on: ubuntu-latest permissions: pull-requests: write diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml new file mode 100644 index 00000000000..c916c8b06c3 --- /dev/null +++ b/.github/workflows/docs-release.yml @@ -0,0 +1,71 @@ +name: Rebuild docs with the latest release + +on: + release: + types: [released] + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '18' + + - name: Install wasm-bindgen-cli + uses: taiki-e/install-action@v2 + with: + tool: wasm-bindgen-cli@0.2.86 + + - name: Install wasm-opt + run: | + npm i wasm-opt -g + + - name: Install dependencies + run: yarn + + - name: Build acvm_js + run: yarn workspace @noir-lang/acvm_js build + + - name: Build noirc_abi + run: yarn workspace @noir-lang/noirc_abi build + + - name: Build noir_js_types + run: yarn workspace @noir-lang/types build + + - name: Build barretenberg wrapper + run: yarn workspace @noir-lang/backend_barretenberg build + + - name: Run noir_js + run: | + yarn workspace @noir-lang/noir_js build + + - 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: + 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 release" + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d785eefbc14..95da6792f04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,7 @@ jobs: - name: Dispatch to publish workflow uses: benc-uk/workflow-dispatch@v1 with: - workflow: publish-docs.yml + workflow: docs-new-version.yml repo: noir-lang/noir ref: master token: ${{ secrets.GITHUB_TOKEN }}