Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint PR Title

on:
pull_request_target:
types: [opened, edited, synchronize]

permissions:
pull-requests: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release Please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember why I did it, but I explicitly used the SDK Automation Bot's token here: https://github.com/workos/workos-ruby/blob/f156c799e88269493104628760f94b8abaebf542/.github/workflows/release-please.yml#L16-L21

Granted, there's always been divergence between the Node SDK and all the others. I think it had something to do with permissions, but I see you're defining them up—maybe I was missing id-token? Nothing to change here, just pointing it out in case it does not work!


publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
uses: ./.github/workflows/release.yml
43 changes: 8 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
name: Release

on:
# Support manually pushing a new release
workflow_dispatch: {}
# Trigger when a release or a pre-release is published
release:
types: [published]

defaults:
run:
shell: bash
workflow_dispatch:
workflow_call:

jobs:
test:
name: Publish to NPM
publish:
name: Publish to npm
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -23,35 +16,15 @@ jobs:
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: |
npm install
run: npm install

- name: Build Project
run: |
npm run build
run: npm run build

- name: Run Tests
run: |
npm run test
run: npm run test

- name: Publish
if: ${{ !github.event.release.prerelease }}
run: |
npm publish --tag latest --access=public --provenance

- name: Publish Pre-Release
if: ${{ github.event.release.prerelease }}
run: |
# Tags may come prefixed with "v" which we want to remove before putting
# it as the version of this deploy. E.g. this will turn "v7.5.0-beta" to "7.5.0-beta"
CLEAN_TAG=$(echo "${{ github.event.release.tag_name }}" | sed 's/[^0-9]//')
jq ".version=\"${CLEAN_TAG}\"" package.json > package.json.deploy
cp package.json.deploy package.json

echo "Deploying with package.json"
cat package.json

npm publish --tag next --access=public --provenance
run: npm publish --tag latest --access public --provenance
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "8.2.0"
}
3 changes: 1 addition & 2 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module.exports = {
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['./setup-jest.ts'],
transform: {
'^.+\\.ts?$': 'ts-jest',
'^.+\\.m?js$': '<rootDir>/jest-transform-esm.cjs',
'^.+\\.m?[jt]s$': '<rootDir>/jest-transform-esm.cjs',
},
transformIgnorePatterns: [
'node_modules/(?!(iron-webcrypto|uint8array-extras|@noble|@scure|jose)/)',
Expand Down
154 changes: 0 additions & 154 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"jest-fetch-mock": "^3.0.3",
"miniflare": "^4.20251004.0",
"prettier": "^3.5.3",
"ts-jest": "29.4.4",
"tsdown": "^0.17.0",
"tsx": "^4.20.6",
"typescript": "5.9.3",
Expand Down
11 changes: 11 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": false,
"packages": {
".": {
"release-type": "node",
"changelog-path": "CHANGELOG.md",
"versioning": "default"
}
}
}
3 changes: 1 addition & 2 deletions src/workos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ import { CryptoProvider } from './common/crypto/crypto-provider';
import { ParseError } from './common/exceptions/parse-error';
import { getEnv } from './common/utils/env';
import { getRuntimeInfo } from './common/utils/runtime-info';

const VERSION = '8.6.0';
import { version as VERSION } from '../package.json' with { type: 'json' };

const DEFAULT_HOSTNAME = 'api.workos.com';

Expand Down