From d562a1dc59f2a7860d4066ba036e446cbf716e7c Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 4 Oct 2025 09:26:29 -0700 Subject: [PATCH 1/2] Add publish workflor for Browser --- .github/workflows/publishBrowser.yml | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/publishBrowser.yml diff --git a/.github/workflows/publishBrowser.yml b/.github/workflows/publishBrowser.yml new file mode 100644 index 00000000..e911e243 --- /dev/null +++ b/.github/workflows/publishBrowser.yml @@ -0,0 +1,62 @@ +name: Publish @simplewebauthn/browser + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write # The OIDC ID token is used for authentication with JSR and NPM + + env: + NODE_VERSION: '22.x' + DENO_VERSION: 'v2.4.x' + + steps: + - uses: actions/checkout@v5 + + # Install Node + - name: Setup Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v5 + with: + node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' + - name: Upgrade NPM + # Trusted Publishing requires at least npm 11.5.1 + run: npm install -g npm@^11.5.1 + + - name: Confirm installed Node and NPM versions + run: 'echo "Node: $(node -v)" && echo "NPM: $(npm -v)"' + + # Install Deno + - name: Setup Deno ${{ env.DENO_VERSION }} + uses: denoland/setup-deno@v2 + with: + deno-version: ${{ env.DENO_VERSION }} + - name: Confirm installed Deno version + run: deno -V + + # Set up caching for quicker installs + - name: Get DENO_DIR store directory + shell: bash + # Expecting "DENO_DIR location: /Users/matt/Library/Caches/deno" somewhere in `deno info` + run: | + echo "DENO_DIR=$(deno info | grep "DENO_DIR" | awk '{print $3}')" >> $GITHUB_ENV + - name: Setup Deno cache + uses: actions/cache@v4 + with: + path: ${{ env.DENO_DIR }} + key: ${{ runner.os }}-deno-dir-${{ hashFiles('**/deno.lock') }} + restore-keys: | + ${{ runner.os }}-deno-dir- + + # Install deps + - name: Install dependencies + run: deno install + + # Publish to JSR and NPM + - name: Publish to JSR and NPM + run: deno task publish:browser From d616c232d4272fcf1aea4e6c9ad6d184fc56b2d2 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sat, 4 Oct 2025 09:26:48 -0700 Subject: [PATCH 2/2] Update HANDBOOK for new publish process --- HANDBOOK.md | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/HANDBOOK.md b/HANDBOOK.md index 2ef2a3f9..19da0a8c 100644 --- a/HANDBOOK.md +++ b/HANDBOOK.md @@ -39,28 +39,22 @@ Add entries to CHANGELOG.md for the packages determined in the step above. Commit these changes. -### Step 4: Publish packages +### Step 4: Create a git tag for the chosen version -The following commands can be run from the root of the monorepo to build the respective package, -then **publish it to both [NPM](https://www.npmjs.com/search?q=%40simplewebauthn) and -[JSR](https://jsr.io/@simplewebauthn)**. +Create a tag on HEAD for the new version number. -#### Need to publish @simplewebauthn/browser? +### Step 5: Push up `HEAD` to `origin` -``` -deno task publish:browser -``` +Don't forget to push up the new tag to `origin` too! -#### Need to publish @simplewebauthn/server? +### Step 6: Publish packages -``` -deno task publish:server -``` +#### Need to publish @simplewebauthn/browser? -### Step 5: Create a git tag for the chosen version +Navigate to https://github.com/MasterKale/SimpleWebAuthn/actions/workflows/publishBrowser.yml and +**Run workflow** against **master**. -Create a tag on HEAD for the new version number. - -### Step 6: Push up `HEAD` to `origin` +#### Need to publish @simplewebauthn/server? -Don't forget to push up the latest changes to `origin` when everything's been published! +Navigate to https://github.com/MasterKale/SimpleWebAuthn/actions/workflows/publicServer.yml and +**Run workflow** against **master**.