Skip to content

Commit 1153c7f

Browse files
committed
Trusted publishing, update CI
1 parent 1f30a05 commit 1153c7f

File tree

3 files changed

+31
-54
lines changed

3 files changed

+31
-54
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ jobs:
2222
node-version: [20.x]
2323

2424
steps:
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v5
26+
- name: Enable Corepack
27+
run: corepack enable
2628
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v4
29+
uses: actions/setup-node@v6
2830
with:
2931
node-version: ${{ matrix.node-version }}
30-
cache: 'npm'
32+
cache: 'yarn'
3133

3234
- uses: browser-actions/setup-chrome@v1
3335
id: setup-chrome
@@ -36,17 +38,6 @@ jobs:
3638
- run: |
3739
${{ steps.setup-chrome.outputs.chrome-path }} --version
3840
39-
# Install yarn dependencies.
40-
- name: Get yarn cache directory path
41-
id: yarn-cache-dir-path
42-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
43-
- uses: actions/cache@v4
44-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
45-
with:
46-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
47-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
48-
restore-keys: |
49-
${{ runner.os }}-yarn-
5041
- run: yarn install
5142
- name: Test with checked-in WASM files
5243
run: yarn test

.github/workflows/dev-packages.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,52 @@ name: Release
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: [master]
6+
workflow_dispatch: # For dev publishing
77

88
concurrency: ${{ github.workflow }}-${{ github.ref }}
99

10+
permissions:
11+
id-token: write # Required for OIDC / trusted publishing
12+
contents: write # Required for changesets pushing commits
13+
pull-requests: write # Required for changesets creating PRs
14+
1015
jobs:
1116
release:
1217
name: Release
1318
runs-on: ubuntu-latest
1419
steps:
1520
- name: Checkout Repo
16-
uses: actions/checkout@v3
17-
18-
- name: Setup Node.js 16
19-
uses: actions/setup-node@v3
21+
uses: actions/checkout@v5
22+
- name: Enable Corepack
23+
run: corepack enable
24+
- name: Setup Node.js 20
25+
uses: actions/setup-node@v6
2026
with:
2127
node-version: 20
28+
cache: yarn
29+
- name: Update npm
30+
run: |
31+
npm install -g npm@latest
32+
npm --version
2233
2334
- name: Install Dependencies
24-
run: yarn
35+
run: yarn install --frozen-lockfile
2536

2637
- name: Create Release Pull Request or Publish to npm
2738
id: changesets
2839
uses: changesets/action@v1
40+
if: ${{ github.event_name == 'push' }}
2941
with:
3042
# This expects you to have a script called release which does a build for your packages and calls changeset publish
3143
publish: yarn release
3244
version: yarn changeset version
3345
env:
3446
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
- name: Dev publish
48+
if: ${{ github.event_name == 'workflow_dispatch' }}
49+
run: |
50+
yarn changeset version --no-git-tag --snapshot dev
51+
yarn changeset publish --tag dev
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)