-
-
Notifications
You must be signed in to change notification settings - Fork 151
74 lines (60 loc) · 1.78 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
name: Main
on: ["push", "pull_request"]
jobs:
build:
name: Build, test and eventually publish
runs-on: ubuntu-22.04
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v3
with:
version: 9.15.0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Setup ESLint cache
uses: actions/cache@v4
with:
path: ./.eslintcache
key: ${{ runner.os }}-eslint-${{ hashFiles('**/pnpm-lock.yaml', '**/eslint.config.mjs') }}
- name: Lint
run: pnpm lint
- name: Build packages
run: pnpm build
- name: Build docs
run: pnpm docs:build
- name: Publish
if: startsWith(github.event.ref, 'refs/tags/v')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx lerna publish from-package --yes
publish_release:
if: startsWith(github.event.ref, 'refs/tags/v')
name: Publish new release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Extract changes
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
- name: Publish release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{ steps.changelog.outputs.changes }}