-
Notifications
You must be signed in to change notification settings - Fork 6
56 lines (46 loc) · 1.28 KB
/
release.yml
File metadata and controls
56 lines (46 loc) · 1.28 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
on:
workflow_call:
inputs:
tag_name:
description: Release tag name (e.g., v0.12.0-beta.1)
type: string
default: ''
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
cache: pnpm
- name: Install
run: pnpm install
- name: Build
run: pnpm build
- name: Determine npm tag
id: npm-tag
env:
TAG_NAME: ${{ inputs.tag_name }}
run: |
VERSION="${TAG_NAME#v}"
if [[ -z "$VERSION" ]]; then
VERSION="$(node -p "require('./package.json').version")"
fi
if [[ "$VERSION" == *"-"* ]]; then
echo "tag=beta" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Publish
run: |
sed -i '/_authToken/d' "$NPM_CONFIG_USERCONFIG"
unset NODE_AUTH_TOKEN
pnpm publish --tag ${{ steps.npm-tag.outputs.tag }} --access public --no-git-checks --provenance