-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (56 loc) · 1.71 KB
/
version-or-publish.yml
File metadata and controls
61 lines (56 loc) · 1.71 KB
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
name: Publish
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
# Disable all permissions by default, requiring explicit permission definitions for all jobs.
permissions: {}
jobs:
check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: npm
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm test
publish:
needs: check
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
issues: read
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: npm
registry-url: "https://registry.npmjs.org"
# Ensure npm 11.5.1 or later is installed for OIDC authentication.
- name: Update npm
run: npm install -g npm@latest
- name: Install dependencies
run: npm ci
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3
with:
version: npm run bump
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}