-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (70 loc) · 2.96 KB
/
Copy pathrelease.yml
File metadata and controls
73 lines (70 loc) · 2.96 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
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'
# 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@91ab88e2619ed1f46221f0ba42d1492c02baf788 # v6.0.6
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
# Node 24 ships with npm 11.x, which is required for trusted
# publishing via OIDC. Node 22 is on npm 10.x and can't
# self-upgrade cleanly (the upgrade trips on its own module
# tree), so we use 24 directly here. CI still runs on the
# 20/22/24 matrix.
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 the CI workflow runs.
# A bad build should never reach npm.
- run: pnpm lint
- run: pnpm type-check
- run: pnpm test
- run: pnpm --filter passmint bundle-guard
- run: pnpm --filter passmint size
- run: pnpm --filter passmint publint
- run: pnpm --filter passmint attw
- uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.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.
#
# `pnpm format` after the version bump reformats the files
# changesets just wrote (package.json, CHANGELOG.md) through
# Biome, so the committed PR is already lint-clean. Without
# this, the subsequent release run fails `pnpm lint` because
# changesets' JSON writer and Biome disagree on formatting.
version: pnpm run 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 }}