-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.67 KB
/
Copy pathrelease.yml
File metadata and controls
69 lines (66 loc) · 2.67 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
name: Release
on:
push:
branches: [main]
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
# Don't run on forks.
if: github.repository == 'getpassmint/passmint-node'
# Gate publishes through the `production` GitHub environment. This
# matches the `environment` claim in the trusted publisher config
# on npmjs.com and gives us a place to hang required reviewers or
# environment-scoped secrets later without touching this file.
environment: production
permissions:
# Push the "Version Packages" PR and tags.
contents: write
pull-requests: write
# Required for npm trusted publishing via OIDC.
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Changesets needs full history to detect version bumps.
fetch-depth: 0
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
# Node 24 ships with npm 11.x, which is required for trusted
# publishing via OIDC.
node-version: '24'
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- run: pnpm install --frozen-lockfile
- run: pnpm build
# Gate the release on the same checks CI runs. A bad build should
# never reach npm.
- run: pnpm lint
- run: pnpm type-check
- run: pnpm test
- run: pnpm publint
- run: pnpm attw
- uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
with:
# When there are pending changesets, opens/updates the
# "Version Packages" PR. When that PR is merged and the
# changesets are gone, `publish` runs and ships to npm.
#
# The changesets action spawns this command WITHOUT a shell, so
# `&&` chains don't work here — the chain lives in the
# `version-packages` package.json script instead (scripts run
# through a shell). It bumps versions, then reformats the files
# changesets just wrote through Biome, so the committed PR is
# already lint-clean.
version: pnpm version-packages
publish: pnpm changeset publish
commit: 'chore: version packages'
title: 'chore: version packages'
env:
# Trusted publishing handles npm auth + provenance automatically
# via the OIDC token minted by `permissions: id-token: write`.
# No NPM_TOKEN needed.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}