Repository navigation
61 lines (48 loc) · 1.59 KB
/
Copy pathpublish.yml
File metadata and controls
61 lines (48 loc) · 1.59 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
name: Publish Package
on:
# Triggered by the Release workflow (workflow_dispatch) and by manually published GitHub releases.
workflow_dispatch:
release:
types: [published]
permissions:
id-token: write
contents: read
concurrency:
group: publish
cancel-in-progress: false
jobs:
test:
uses: ./.github/workflows/test.yml
publish:
needs: test
runs-on: ubuntu-latest
environment:
name: release
env:
NPM_CONFIG_PROVENANCE: true
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
# release tag when triggered by a release, default branch otherwise
ref: ${{ github.event.release.tag_name || github.ref }}
- uses: pnpm/action-setup@v6
name: Install pnpm
with:
run_install: false
- name: Use node.js
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Upgrade npm for OIDC
run: npm install -g npm@11.11.0
- name: Clear auth token for OIDC
run: echo "NODE_AUTH_TOKEN=" >> "$GITHUB_ENV"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Publish released packages
run: pnpm release:publish