Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adding docs to release please #3571

Merged
merged 6 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 0 additions & 112 deletions .github/workflows/docs-new-version.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ jobs:
- name: Install Yarn dependencies
uses: ./.github/actions/setup

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

- name: Build docs
working-directory: docs
run:
Expand Down
72 changes: 0 additions & 72 deletions .github/workflows/docs-release.yml

This file was deleted.

84 changes: 76 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,42 @@ jobs:
git commit -m 'chore: Update lockfile'
git push


update-docs:
name: Update docs
needs: [release-please, update-lockfile]
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 Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install Yarn dependencies
uses: ./.github/actions/setup

- name: Cut a new version
working-directory: ./docs
run: yarn docusaurus docs:version ${{ needs.release-please.outputs.tag-name }}

- name: Configure git
run: |
git config --local user.name 'signorecello'
git config --local user.email '[email protected]'

- name: Commit new documentation version
run: |
git add .
git commit -m "chore(docs): cut new docs version for tag ${{ needs.release-please.outputs.tag-name }}"
git push

build-binaries:
name: Build binaries
needs: [release-please]
Expand Down Expand Up @@ -78,19 +114,51 @@ jobs:
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}
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
- name: Checkout release branch
uses: actions/checkout@v4
with:
workflow: docs-new-version.yml
repo: noir-lang/noir
ref: master
token: ${{ secrets.GITHUB_TOKEN }}
inputs: '{ "tag": "${{ needs.release-please.outputs.tag-name }}"}'
ref: ${{ needs.release-please.outputs.tag-name }}
token: ${{ secrets.NOIR_RELEASES_TOKEN }}

- 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: [email protected]

- name: Install wasm-opt
run: |
npm i wasm-opt -g

- name: Install Yarn dependencies
uses: ./.github/actions/setup

- name: Build docs for deploying
working-directory: docs
run:
yarn workspaces foreach -Rt run build

- name: Deploy to Netlify
uses: nwtgck/[email protected]
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
signorecello marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
"type": "json",
"path": "tooling/noirc_abi_wasm/package.json",
"jsonpath": "$.version"
},
{
"type": "json",
"path": "docs/docs/package.json",
"jsonpath": "$.version"
}
]
},
Expand Down
Loading