Skip to content

Commit d927f53

Browse files
committed
chore: modernize release workflow
- Update actions/checkout v2 to v6 - Fix pnpm/node step order for proper caching - Use npm trusted publishers (OIDC) instead of NPM_TOKEN - Update pnpm to version 10 - Use setupGitUser for GitHub Actions bot signed commits - Add proper permissions for changesets (contents, pull-requests) - Add cancel-in-progress to concurrency - Remove unnecessary matrix strategy - Use built-in pnpm caching via setup-node
1 parent ca6c515 commit d927f53

File tree

1 file changed

+18
-46
lines changed

1 file changed

+18
-46
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,38 @@ on:
88
- main
99
workflow_dispatch:
1010

11-
concurrency: ${{ github.workflow }}-${{ github.ref }}
12-
13-
env:
14-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
1614

1715
jobs:
1816
release:
1917
name: Publish to npm
2018
permissions:
2119
id-token: write
22-
strategy:
23-
matrix:
24-
os: [ubuntu-latest]
25-
node-version: [lts/*]
26-
pnpm-version: [8.9.0]
27-
runs-on: ${{ matrix.os }}
20+
contents: write
21+
pull-requests: write
22+
runs-on: ubuntu-latest
2823
steps:
2924
- name: ⬇️ Checkout
3025
id: checkout
31-
uses: actions/checkout@v2.3.3
26+
uses: actions/checkout@v6
3227
with:
33-
token: ${{ env.GITHUB_TOKEN }}
3428
fetch-depth: 0
35-
persist-credentials: false
36-
37-
- name: 🟢 Setup node
38-
id: setup-node
39-
uses: actions/setup-node@v4
40-
with:
41-
node-version: ${{ matrix.node-version }}
4229

4330
- name: 🥡 Setup pnpm
4431
id: setup-pnpm
4532
uses: pnpm/action-setup@v4
4633
with:
47-
version: ${{ matrix.pnpm-version }}
4834
run_install: false
4935

50-
- name: 🎈 Get pnpm store directory
51-
id: get-pnpm-cache-dir
52-
run: |
53-
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
54-
55-
- name: 🔆 Cache pnpm modules
56-
uses: actions/cache@v3
57-
id: pnpm-cache
36+
- name: 🟢 Setup node
37+
id: setup-node
38+
uses: actions/setup-node@v4
5839
with:
59-
path: ${{ steps.get-pnpm-cache-dir.outputs.pnpm_cache_dir }}
60-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
61-
restore-keys: |
62-
${{ runner.os }}-pnpm-store-
40+
node-version: lts/*
41+
cache: pnpm
42+
cache-dependency-path: pnpm-lock.yaml
6343

6444
- name: 🧩 Install Dependencies
6545
id: install-dependencies
@@ -71,20 +51,14 @@ jobs:
7151

7252
- name: 🏗️ Build
7353
id: build-the-mono-repo
74-
run: |
75-
pnpm build
54+
run: pnpm build
7655

77-
- name: Load SSH signing key
56+
- name: 🔐 Configure git signing
7857
run: |
7958
echo "${{ secrets.SSH_SIGNING_PK }}" > /tmp/.git_signing_key
8059
chmod 600 /tmp/.git_signing_key
81-
shell: bash
82-
83-
- name: Set git user
84-
shell: bash
85-
run: |
86-
git config user.name "isburnt"
87-
git config user.email "[email protected]"
60+
git config user.name "github-actions[bot]"
61+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
8862
git config commit.gpgsign true
8963
git config gpg.format ssh
9064
git config user.signingkey /tmp/.git_signing_key
@@ -99,6 +73,4 @@ jobs:
9973
commit: "chore: update versions"
10074
setupGitUser: false
10175
env:
102-
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
103-
NPM_CONFIG_PROVENANCE: false
104-
NPM_TOKEN: ''
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)