-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (72 loc) · 2.3 KB
/
build-and-publish.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
# This workflow does a build and test of all packages
name: Build and Test
on:
push:
branches:
- main
paths-ignore:
- "README.md"
pull_request:
paths-ignore:
- "README.md"
schedule:
- cron: "0 20 * * *"
jobs:
build:
runs-on: ubuntu-latest
name: Build and test
steps:
- name: checkout
uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
version: 7.9.5
- name: setup node
uses: actions/setup-node@v2
with:
node-version: "16.*"
cache: "pnpm"
# Why do we explicitly do pnpm install here and not use "run_install: true" above in the pnpm setup?
# We need to have pnpm setup before node in order to take advantage of the inbuilt caching that is available
# in that action, and running an install as part of pnpm setup won't use the cache, so we'll explicitly
# run it here after the cache
- run: pnpm install
- name: Lint
run: pnpm lint
- name: Build
run: pnpm build
- name: Check that action dist folders are up to date
run: pnpm ci:checkdist
- name: Test
run: pnpm test
publish:
runs-on: ubuntu-latest
name: Publish actions
needs: build
# Only run publishing on commits that perform versioning
if: ${{ startsWith(github.event.commits[0].message, 'Version Packages') }}
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: pnpm/[email protected]
with:
version: 7.9.5
- name: setup node
uses: actions/setup-node@v2
with:
node-version: "16.*"
cache: "pnpm"
# Why do we explicitly do pnpm install here and not use "run_install: true" above in the pnpm setup?
# We need to have pnpm setup before node in order to take advantage of the inbuilt caching that is available
# in that action, and running an install as part of pnpm setup won't use the cache, so we'll explicitly
# run it here after the cache
- run: pnpm install
- run: pnpm build
- name: Publish
uses: changesets/[email protected]
with:
publish: pnpm run ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}