Skip to content

Commit cf4f699

Browse files
authored
Merge pull request #727 from MasterKale/feat/automated-publishing-browser
Add new Browser publish workflow
2 parents a4bff9c + d616c23 commit cf4f699

File tree

2 files changed

+73
-17
lines changed

2 files changed

+73
-17
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish @simplewebauthn/browser
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
contents: read
12+
id-token: write # The OIDC ID token is used for authentication with JSR and NPM
13+
14+
env:
15+
NODE_VERSION: '22.x'
16+
DENO_VERSION: 'v2.4.x'
17+
18+
steps:
19+
- uses: actions/checkout@v5
20+
21+
# Install Node
22+
- name: Setup Node.js ${{ env.NODE_VERSION }}
23+
uses: actions/setup-node@v5
24+
with:
25+
node-version: ${{ env.NODE_VERSION }}
26+
registry-url: 'https://registry.npmjs.org'
27+
- name: Upgrade NPM
28+
# Trusted Publishing requires at least npm 11.5.1
29+
run: npm install -g npm@^11.5.1
30+
31+
- name: Confirm installed Node and NPM versions
32+
run: 'echo "Node: $(node -v)" && echo "NPM: $(npm -v)"'
33+
34+
# Install Deno
35+
- name: Setup Deno ${{ env.DENO_VERSION }}
36+
uses: denoland/setup-deno@v2
37+
with:
38+
deno-version: ${{ env.DENO_VERSION }}
39+
- name: Confirm installed Deno version
40+
run: deno -V
41+
42+
# Set up caching for quicker installs
43+
- name: Get DENO_DIR store directory
44+
shell: bash
45+
# Expecting "DENO_DIR location: /Users/matt/Library/Caches/deno" somewhere in `deno info`
46+
run: |
47+
echo "DENO_DIR=$(deno info | grep "DENO_DIR" | awk '{print $3}')" >> $GITHUB_ENV
48+
- name: Setup Deno cache
49+
uses: actions/cache@v4
50+
with:
51+
path: ${{ env.DENO_DIR }}
52+
key: ${{ runner.os }}-deno-dir-${{ hashFiles('**/deno.lock') }}
53+
restore-keys: |
54+
${{ runner.os }}-deno-dir-
55+
56+
# Install deps
57+
- name: Install dependencies
58+
run: deno install
59+
60+
# Publish to JSR and NPM
61+
- name: Publish to JSR and NPM
62+
run: deno task publish:browser

HANDBOOK.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,22 @@ Add entries to CHANGELOG.md for the packages determined in the step above.
3939

4040
Commit these changes.
4141

42-
### Step 4: Publish packages
42+
### Step 4: Create a git tag for the chosen version
4343

44-
The following commands can be run from the root of the monorepo to build the respective package,
45-
then **publish it to both [NPM](https://www.npmjs.com/search?q=%40simplewebauthn) and
46-
[JSR](https://jsr.io/@simplewebauthn)**.
44+
Create a tag on HEAD for the new version number.
4745

48-
#### Need to publish @simplewebauthn/browser?
46+
### Step 5: Push up `HEAD` to `origin`
4947

50-
```
51-
deno task publish:browser
52-
```
48+
Don't forget to push up the new tag to `origin` too!
5349

54-
#### Need to publish @simplewebauthn/server?
50+
### Step 6: Publish packages
5551

56-
```
57-
deno task publish:server
58-
```
52+
#### Need to publish @simplewebauthn/browser?
5953

60-
### Step 5: Create a git tag for the chosen version
54+
Navigate to https://github.com/MasterKale/SimpleWebAuthn/actions/workflows/publishBrowser.yml and
55+
**Run workflow** against **master**.
6156

62-
Create a tag on HEAD for the new version number.
63-
64-
### Step 6: Push up `HEAD` to `origin`
57+
#### Need to publish @simplewebauthn/server?
6558

66-
Don't forget to push up the latest changes to `origin` when everything's been published!
59+
Navigate to https://github.com/MasterKale/SimpleWebAuthn/actions/workflows/publicServer.yml and
60+
**Run workflow** against **master**.

0 commit comments

Comments
 (0)