Repository navigation
73 lines (59 loc) · 1.88 KB
/
Copy pathrelease.yml
File metadata and controls
73 lines (59 loc) · 1.88 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: release
permissions:
contents: read
id-token: write
on:
push:
branches:
- master
- alpha
workflow_dispatch:
inputs:
publish_tag:
description: 'npm tag to publish with (default: latest)'
required: false
default: 'latest'
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Locate pnpm store
id: pnpm-store
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-node-24-pnpm-11.7.0-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml') }}
restore-keys: |
${{ runner.os }}-node-24-pnpm-11.7.0-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
- name: Build
run: pnpm run build
- name: Unset NODE_AUTH_TOKEN
run: unset NODE_AUTH_TOKEN
- name: Publish (master)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: npm publish --access public --provenance
- name: Publish (alpha)
if: github.event_name == 'push' && github.ref == 'refs/heads/alpha'
run: npm publish --tag alpha --access public --provenance
- name: Publish (manual)
if: github.event_name == 'workflow_dispatch'
run: npm publish --tag "${{ inputs.publish_tag || 'latest' }}" --access public --provenance