-
Notifications
You must be signed in to change notification settings - Fork 62
83 lines (72 loc) · 2.38 KB
/
release.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
name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
check-version:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check Version
run: bash ./scripts/check_version.sh ${GITHUB_REF/refs\/tags\//}
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
always-auth: true
registry-url: 'https://registry.npmjs.org'
- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
shell: bash
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Get the release notes
id: get_release_notes
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
NOTES="$(awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md)"
NOTES="${NOTES//'%'/'%25'}"
NOTES="${NOTES//$'\n'/'%0A'}"
NOTES="${NOTES//$'\r'/'%0D'}"
echo ::set-output name=NOTES::"$NOTES"
- name: Generate documentation
run: yarn docs
- uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Upload docs
run: bash ./scripts/upload_docs.sh ${GITHUB_REF/refs\/tags\//}
- name: Publish modules
run: |
yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Github Release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.get_release_notes.outputs.NOTES }}
draft: false
prerelease: false