-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.04 KB
/
publish.yml
File metadata and controls
49 lines (40 loc) · 1.04 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
name: Publish Package
on:
push:
tags: ['v*']
permissions:
id-token: write
contents: read
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enforce tag on main
run: |
git fetch origin main
git merge-base --is-ancestor ${{ github.sha }} origin/main || {
echo "::error::Version tags (v*) must point to a commit on main. This tag was created from another branch."
exit 1
}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Typecheck, lint, test, and build
run: npm run ci
env:
CI: true
- name: Publish to npm
run: npm publish