Repository navigation
63 lines (55 loc) · 1.98 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (55 loc) · 1.98 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
name: Release
# On every push to main, changesets/action either opens a "Version Packages"
# pull request from the pending changesets, or publishes to npm when that pull
# request is merged.
#
# Publishing uses npm Trusted Publishing (OIDC) with provenance, so there is no
# npm token. The Trusted Publisher of `micro` on npmjs.com must use:
# Repository: vercel/micro
# Workflow: release.yml
# npm binds the Trusted Publisher to this file name: renaming this file breaks
# publishing until the npm configuration is updated.
#
# changesets/action pushes the release commit and the tags through the GitHub
# API, so GitHub signs them.
#
# Run this workflow manually on main to retry a failed publish. The 9.x branch
# has its own release.yml, which publishes canary versions: run it manually on
# 9.x.
#
# See https://docs.npmjs.com/trusted-publishers
on:
push:
branches:
- main
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
# Node 24 ships an npm version that can authenticate the publish with OIDC.
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: pnpm
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Create release pull request or publish to npm
uses: changesets/action@198f833dd7d863100ea6e28967bc9a9fdefadb0a # v2.1.0
with:
publish-script: pnpm release
env:
NPM_CONFIG_PROVENANCE: 'true'