diff --git a/.github/workflows/docs-test.yml b/.github/workflows/docs-test.yml new file mode 100644 index 00000000000..84323ebf11e --- /dev/null +++ b/.github/workflows/docs-test.yml @@ -0,0 +1,132 @@ +name: Release + +on: + push: + branches: + - zpedro/docs_workflow + +jobs: + release-please: + name: Create Release + outputs: + release-pr: ${{ steps.release.outputs.pr }} + tag-name: ${{ steps.release.outputs.tag_name }} + runs-on: ubuntu-latest + steps: + - name: Run release-please + id: release + uses: google-github-actions/release-please-action@v3 + with: + token: ${{ secrets.NOIR_RELEASES_TOKEN }} + command: manifest + default-branch: zpedro/docs_workflow + + update-lockfile: + name: Update lockfile + needs: [release-please] + if: ${{ needs.release-please.outputs.release-pr }} + runs-on: ubuntu-latest + steps: + - name: Checkout release branch + uses: actions/checkout@v4 + with: + ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }} + token: ${{ secrets.NOIR_RELEASES_TOKEN }} + + - name: Setup toolchain + uses: dtolnay/rust-toolchain@1.65.0 + + - name: Update lockfile + run: | + cargo update --workspace + + - name: Configure git + run: | + git config user.name kevaundray + git config user.email kevtheappdev@gmail.com + + - name: Commit updates + run: | + git add Cargo.lock + git commit -m 'chore: Update lockfile' + git push + + publish-docs: + name: Publish docs + needs: [release-please] + if: ${{ needs.release-please.outputs.release-pr }} + runs-on: ubuntu-latest + steps: + - name: Checkout release branch + uses: actions/checkout@v4 + with: + ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }} + token: ${{ secrets.NOIR_RELEASES_TOKEN }} + + - name: Print Release Tag Name + run: echo "Tag name is ${{ needs.release-please.outputs.tag-name }}" + + - 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 Yarn + run: npm install -g yarn + + - name: Install Yarn 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: Cut a new version + working-directory: ./docs + run: yarn docusaurus docs:version ${{ needs.release-please.outputs.tag-name }} + + - name: Commit new documentation version + run: | + git config --local user.name 'signorecello' + git config --local user.email 'github@zepedro.me' + git add . + git commit -m "chore(docs): cut new docs version for tag ${{ needs.release-please.outputs.tag-name }}" + git push + + - name: Build docs for deploying + 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 ${{ needs.release-please.outputs.tag-name }}" + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + timeout-minutes: 1 diff --git a/docs/package.json b/docs/package.json index 09f8d718b56..57b7c6bfff5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,8 +4,8 @@ "private": true, "scripts": { "start": "docusaurus start", - "build": "docusaurus build", - "setStable": "node ./scripts/setStable.js" + "build": "yarn version::stables && docusaurus build", + "version::stables": "node ./scripts/setStable.js" }, "dependencies": { "@docusaurus/core": "^2.4.0",