Skip to content
Open
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
14 changes: 10 additions & 4 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- main
workflow_dispatch:

permissions:
id-token: write # Required for OIDC
contents: read

jobs:
release-if-necessary:
runs-on: ubuntu-latest
Expand All @@ -26,11 +30,15 @@ jobs:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
registry-url: 'https://registry.npmjs.org'

# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest

- name: Install dependencies 📥
run: npm ci

Expand All @@ -49,12 +57,10 @@ jobs:
if: steps.check-release.outputs.release-type == 'stable'
run: npm publish --workspace=${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.REQUEST_BOT_NPM_TOKEN }}
VITE_WEB3MODAL_PROJECT_ID: ${{ secrets.VITE_WEB3MODAL_PROJECT_ID }}

- name: Publish next version 📦
if: steps.check-release.outputs.release-type == 'next'
run: npm run publish-next-release --workspace=${{ matrix.package }}
env:
NODE_AUTH_TOKEN: ${{ secrets.REQUEST_BOT_NPM_TOKEN }}
VITE_WEB3MODAL_PROJECT_ID: ${{ secrets.VITE_WEB3MODAL_PROJECT_ID }}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ Each component has its own version number. The versioning scheme we use is

1. Increase the version number of a given component by running `npm version <major|minor|patch>` inside the package directory or by using the `--workspace=<package>` flag from the root directory.
2. Create a PR.
3. When the PR is merged, the CI will automatically publish the new version to NPM.
3. When the PR is merged, the CI will automatically publish the new version to NPM using OIDC Trusted Publisher authentication (no manual tokens required).
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Run changeset version command to bump the version of the packages that have chan
npx changeset version
```

Push the changes to the remote repository. Once the changes are merged, the new versions will be deployed automatically.
Push the changes to the remote repository. Once the changes are merged, the new versions will be deployed automatically using OIDC Trusted Publisher authentication.

For more info about workinng with NPM workspaces see:
For more info about working with NPM workspaces see:
https://docs.npmjs.com/cli/v8/using-npm/workspaces