-
Notifications
You must be signed in to change notification settings - Fork 23
87 lines (72 loc) · 2.16 KB
/
main.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
name: Build & Test CI
concurrency: main
on:
push:
branches:
- main
jobs:
version:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.version.outputs.changes }} # map step output to job output
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
token: ${{ secrets.SERVICE_ACCOUNT_PAT }}
- name: Enable node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
scope: '@wanews'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Cache .pnpm-store
uses: actions/cache@v1
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install pnpm
run: |
npm i -g pnpm@9
- name: Set verify-store-integrity
run: |
pnpm set verify-store-integrity false
- name: pnpm install
run: |
pnpm install --frozen-lockfile
- name: Version command
id: version
run: |
pnpm changeset version
env:
GITHUB_TOKEN: ${{ secrets.SERVICE_ACCOUNT_PAT }}
- name: pnpm install
run: |
pnpm install
- name: Push changes
run: |
git config user.email "[email protected]"
git config user.name "SWM GitHub Service Account"
git add -A
git commit -m "Version packages" || echo "No changes to commit"
git push
- name: typecheck
run: pnpm tsc -b
- name: Build packages
run: pnpm run build
- name: Lint types and code
run: pnpm run lint
- name: Run tests
run: pnpm test
- name: Run e2e tests
run: pnpm e2e
- name: Release packages
uses: changesets/action@master
with:
publish: pnpm changeset publish
env:
GITHUB_TOKEN: ${{ secrets.SERVICE_ACCOUNT_PAT }}