-
Notifications
You must be signed in to change notification settings - Fork 252
112 lines (90 loc) · 3.13 KB
/
docs-new-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Cut a new version of the 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
contents: write
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Create new branch
run: |
git checkout -b new-docs-version-${{ github.event.inputs.tag }}
- 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: 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 'github@zepedro.me'
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
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