-
Notifications
You must be signed in to change notification settings - Fork 68
93 lines (89 loc) · 2.66 KB
/
deploy.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
name: Deploy
on:
push:
branches:
- develop
- release
- master
jobs:
canary:
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.ref_name == 'develop' && github.repository_owner == 'dequelabs'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
# Ensure packages are built
- run: npm run build
# Make sure the working tree is clean
- run: git reset --hard HEAD
- run: npm config set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
- run: |
npx lerna publish prepatch \
--no-verify-access \
--no-git-tag-version \
--no-push \
--canary \
--dist-tag=next \
--exact \
--preid=$(git rev-parse --short HEAD) \
--force-publish \
--yes
relase-candidate:
runs-on: ubuntu-latest
if: github.ref_name == 'release' && github.repository_owner == 'dequelabs'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
# Ensure packages are built
- run: npm run build
# Make sure the working tree is clean
- run: git reset --hard HEAD
- run: npm config set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
- run: |
npx lerna publish prepatch \
--no-verify-access \
--no-git-tag-version \
--no-push \
--canary \
--dist-tag=rc \
--exact \
--preid=$(git rev-parse --short HEAD) \
--force-publish \
--yes
production:
runs-on: ubuntu-latest
if: github.ref_name == 'master' && github.repository_owner == 'dequelabs'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
# Ensure packages are built
- run: npm run build
# Make sure the working tree is clean
- run: git reset --hard HEAD
- run: npm config set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
- run: |
npx lerna publish from-package \
--force-publish='*' \
--yes
- run: |
PKG_VERSION=$(jq -r .version < lerna.json)
gh release create v$PKG_VERSION \
--title "Release $PKG_VERSION" \
--generate-notes \
--repo ${{ github.repository }} \
--target master
env:
GH_TOKEN: ${{ github.token }}