-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (43 loc) · 1.21 KB
/
Copy pathpublish.yml
File metadata and controls
58 lines (43 loc) · 1.21 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
name: Publish
on:
push:
tags:
- "v*.*.*"
permissions:
contents: read
id-token: write
concurrency:
group: npm-publish
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
environment: npm
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "22.19.0"
cache: npm
# npm Trusted Publishing requires a recent npm CLI.
- name: Update npm
run: npm install --global npm@11
- name: Check tag matches package version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
echo "Tag version: $TAG_VERSION"
echo "Package version: $PACKAGE_VERSION"
test "$TAG_VERSION" = "$PACKAGE_VERSION"
- name: Prepare Pi config directory
run: mkdir -p "$HOME/.pi/agent"
- name: Install dependencies
run: npm ci
- name: Verify
run: npm run verify
- name: Check package contents
run: npm run pack:check
- name: Publish to npm
run: npm publish --access public --provenance