forked from Opencode-DCP/opencode-dynamic-context-pruning
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.29 KB
/
Copy pathpublish.yml
File metadata and controls
49 lines (38 loc) · 1.29 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 to NPM
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
publish:
name: Build & Publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
package-manager-cache: false
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: Build
run: npm run build
- name: Ensure version is not already published
run: |
PKG_NAME=$(node -p "require('./package.json').name")
PKG_VERSION=$(node -p "require('./package.json').version")
if npm view "${PKG_NAME}@${PKG_VERSION}" version >/dev/null 2>&1; then
echo "::error::${PKG_NAME}@${PKG_VERSION} is already published. Bump version before publishing."
exit 1
fi
- name: Publish to NPM
run: npm publish --access public