-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.3 KB
/
release.yml
File metadata and controls
56 lines (46 loc) · 1.3 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
name: Release to npm
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Version to publish (e.g., 0.8.6)"
required: false
type: string
jobs:
publish:
runs-on: ubuntu-latest
environment: production
permissions:
contents: read
id-token: write # Required for OIDC
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/setup-node@v6
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
scope: "@crispthinking"
- name: Update npm
run: npm install -g npm@latest
- name: Set version
run: |
if [[ -n "${{ inputs.version }}" ]]; then
VERSION=${{ inputs.version }}
VERSION=${VERSION#v}
elif [[ "$GITHUB_REF" == refs/tags/* ]]; then
TAG_VERSION=${GITHUB_REF#refs/tags/}
VERSION=${TAG_VERSION#v}
else
VERSION="0.0.0"
fi
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV
npm --no-git-tag-version version "$VERSION"
- run: npm ci
- run: npm run codegen
- run: npm run build:release
- name: Publish
run: npm publish --provenance --access public