-
-
Notifications
You must be signed in to change notification settings - Fork 8
94 lines (85 loc) · 2.7 KB
/
Copy pathrelease.yaml
File metadata and controls
94 lines (85 loc) · 2.7 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Changesets
on:
push:
branches:
- main
# id-token: write enables npm Trusted Publishing (OIDC).
# Do not pass NPM_TOKEN on the publish step — changesets/action prefers a
# long-lived token when set and will skip OIDC.
# See .github/npm-trusted-publishing.md for npmjs.com setup.
permissions:
contents: write
pull-requests: write
id-token: write
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
ci:
uses: ./.github/workflows/ci.yml
snapshot:
name: Publish Snapshot
needs: [ci]
if: |
github.actor != 'github-actions[bot]' &&
!contains(github.event.head_commit.message, 'chore: update versions')
uses: ./.github/workflows/publish-snapshot.yml
permissions:
contents: read
pull-requests: write
secrets: inherit
version:
needs: [ci]
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v4
with:
# Major pin = latest 24.x (CI uses `latest`). npm@12 needs Node >= 24.15.
node-version: 24
registry-url: https://registry.npmjs.org
# Trusted publishing requires npm CLI >= 11.5.1; keep CLI current on this Node line.
- name: Ensure npm supports OIDC trusted publishing
run: npm install -g npm@latest && npm --version
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-v2-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-v2-
- name: install packages
run: |
pnpm install --frozen-lockfile || {
echo "::warning::pnpm install failed; wiping store and retrying"
rm -rf "$(pnpm store path)"
pnpm install --frozen-lockfile
}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: create and publish versions
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}