-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (63 loc) · 2.07 KB
/
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
name: publish
on:
pull_request:
branches:
- master
types: [closed]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
if: startsWith(github.head_ref, 'renovate/')
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["20.x"]
os: [ubuntu-latest]
steps:
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'src/**'
- 'package.json'
- 'pnpm-lock.yaml'
- name: Checkout repo
if: steps.changes.outputs.src == 'true'
uses: actions/checkout@v4
- if: steps.changes.outputs.src == 'true'
run: |
git config user.name "${{ secrets.USER_NAME }}"
git config user.email "${{ secrets.USER_EMAIL }}"
- name: Use Node ${{ matrix.node }}
if: steps.changes.outputs.src == 'true'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install PNPM
if: steps.changes.outputs.src == 'true'
uses: pnpm/action-setup@v4.0.0
- name: Install deps and build (with cache)
if: steps.changes.outputs.src == 'true'
run: pnpm install --no-frozen-lockfile
- name: Lint
if: steps.changes.outputs.src == 'true'
run: pnpm lint
- name: Test
if: steps.changes.outputs.src == 'true'
run: pnpm test -- --ci --coverage --maxWorkers=2
- name: Build
if: steps.changes.outputs.src == 'true'
run: pnpm build
- name: Bump version
if: steps.changes.outputs.src == 'true'
uses: qzb/standard-version-action@v1.0.13
- if: steps.changes.outputs.src == 'true'
run: |
git config --global user.name "${{ secrets.USER_NAME }}"
git config --global user.email "${{ secrets.USER_EMAIL }}"
git push --follow-tags origin master
- if: steps.changes.outputs.src == 'true'
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}