-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.63 KB
/
Copy pathrelease.yml
File metadata and controls
51 lines (44 loc) · 1.63 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
name: Release
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Version & Publish
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Authenticate git with a PAT (or GitHub App token) rather than the
# default GITHUB_TOKEN so the commits the changesets action pushes to
# `changeset-release/main` trigger CI. GitHub suppresses workflow runs
# on GITHUB_TOKEN-authored pushes (recursion guard), which leaves the
# version PR with no required status checks and unmergeable until
# someone re-triggers it. Falls back to GITHUB_TOKEN when RELEASE_PAT
# isn't configured, so releases keep working regardless.
token: ${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
# The `release` script builds packages/* before `changeset publish`.
- name: Create Release PR or Publish
uses: changesets/action@v1
with:
title: "chore: version packages"
commit: "chore: version packages"
version: pnpm changeset:version
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}