-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18a69aa
commit 18aab9d
Showing
6 changed files
with
75 additions
and
187 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,67 @@ | ||
name: Cut a new version of the docs | ||
name: TEST - Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: The tag to build Docs for | ||
required: false | ||
push: | ||
branches: | ||
- zpedro/docs_workflow | ||
|
||
jobs: | ||
publish-docs: | ||
test-release-please: | ||
name: Create Release | ||
outputs: | ||
release-pr: ${{ steps.release.outputs.pr }} | ||
tag-name: ${{ steps.release.outputs.tag_name }} | ||
runs-on: ubuntu-latest | ||
if: ${{ inputs.tag != '' }} | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
- name: Checkout sources | ||
- name: Run release-please | ||
id: release | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
token: ${{ secrets.NOIR_RELEASES_TOKEN }} | ||
command: manifest | ||
|
||
test-update-lockfile: | ||
name: Update lockfile | ||
needs: [test-release-please] | ||
if: ${{ needs.release-please.outputs.release-pr }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout release branch | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }} | ||
token: ${{ secrets.NOIR_RELEASES_TOKEN }} | ||
|
||
- name: Setup toolchain | ||
uses: dtolnay/[email protected] | ||
|
||
- name: Create new branch | ||
- name: Update lockfile | ||
run: | | ||
git checkout -b new-docs-version-${{ github.event.inputs.tag }} | ||
cargo update --workspace | ||
- name: Configure git | ||
run: | | ||
git config user.name kevaundray | ||
git config user.email [email protected] | ||
- name: Commit updates | ||
run: | | ||
git add Cargo.lock | ||
git commit -m 'chore: Update lockfile' | ||
git push | ||
test-publish-docs: | ||
name: Publish docs | ||
needs: [release-please] | ||
if: ${{ needs.release-please.outputs.tag-name }} | ||
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: | ||
|
@@ -60,53 +98,31 @@ jobs: | |
run: | | ||
yarn workspace @noir-lang/noir_js build | ||
- name: Build docs | ||
run: | ||
yarn workspace docs build | ||
|
||
- 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: Commit new documentation version | ||
run: | | ||
git config --local user.name 'signorecello' | ||
git config --local user.email '[email protected]' | ||
git add . | ||
git commit -m "chore(docs): cut new docs version for tag ${{ github.event.inputs.tag }}" | ||
- name: Push changes to new branch | ||
run: git push origin new-docs-version-${{ github.event.inputs.tag }} | ||
|
||
- name: Create Pull Request | ||
run: | | ||
gh pr create \ | ||
--title "chore(docs): docs for ${{ github.event.inputs.tag }}" \ | ||
--body "Updates documentation to new version for tag ${{ github.event.inputs.tag }}." \ | ||
--base master \ | ||
--head new-docs-version-${{ github.event.inputs.tag }} \ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build docs | ||
git push | ||
- name: Build docs for deploying | ||
run: yarn workspace docs build | ||
|
||
- name: Deploy to Netlify | ||
uses: nwtgck/[email protected] | ||
with: | ||
publish-dir: './docs/build' | ||
production-branch: master | ||
production-deploy: true | ||
# 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters