-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (60 loc) · 1.83 KB
/
ci.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
name: 'Test & Release'
on:
push:
branches:
- '**'
pull_request:
branches:
- main
jobs:
test:
name: 'Test package'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install
run: |
npm install
npm run dev:prepare
- name: Lint
run: |
npm run lint:es
npm run lint:types
- name: Test
run: npm run test
release:
name: 'Release package'
needs: [ test ]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install
run: |
npm install
npm run dev:prepare
- name: Release (Renovate)
if: startsWith(github.event.head_commit.message, 'chore(deps)')
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
NEW_VERSION=$(npm version patch -m "chore: bumped package version to %s")
echo -e "# $NEW_VERSION\n- Bumped dependencies\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
git add CHANGELOG.md
git commit --amend --no-edit
git push origin main --tags
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }}
npm run release:ci
- name: Release (Manual)
if: "!startsWith(github.event.head_commit.message, 'chore(deps)')"
run: |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }}
npm run release:ci || true