Skip to content

Commit d3eba96

Browse files
authored
Merge pull request #271 from Gigadrive/feature/oidc-npm-publish
chore: enable npm trusted publishing
2 parents 377dddc + 5ce0e50 commit d3eba96

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

.github/actions/setup/action.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ inputs:
66
description: Node.js version to use
77
required: false
88
default: '22'
9+
registry-url:
10+
description: Registry URL for npm
11+
required: false
12+
default: ''
913

1014
runs:
1115
using: composite
@@ -14,9 +18,10 @@ runs:
1418
uses: pnpm/action-setup@v4
1519

1620
- name: Setup Node.js
17-
uses: useblacksmith/setup-node@v5
21+
uses: actions/setup-node@v4
1822
with:
1923
node-version: ${{ inputs.node-version }}
24+
registry-url: ${{ inputs.registry-url }}
2025
cache: pnpm
2126

2227
- name: Install dependencies

.github/workflows/release.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
jobs:
2121
release:
2222
name: Release
23-
runs-on: blacksmith-4vcpu-ubuntu-2204
23+
runs-on: ubuntu-latest
2424
timeout-minutes: 20
2525

2626
permissions:
@@ -39,6 +39,11 @@ jobs:
3939

4040
- name: Setup
4141
uses: ./.github/actions/setup
42+
with:
43+
registry-url: 'https://registry.npmjs.org'
44+
45+
- name: Upgrade npm (OIDC trusted publishing)
46+
run: npm install -g npm@11.5.1
4247

4348
- name: Build
4449
run: pnpm build
@@ -52,7 +57,6 @@ jobs:
5257
env:
5358
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5459
NPM_CONFIG_PROVENANCE: 'true'
55-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5660

5761
- name: Set latest Release to `gigadrive`
5862
if: steps.changesets.outputs.published == 'true'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"scripts": {
1313
"build": "turbo run build",
1414
"build:no-cache": "turbo run build --force",
15-
"ci:publish": "pnpm publish -r && node scripts/update-canary-tags.mjs && changeset tag",
15+
"ci:publish": "npm publish --workspace=@gigadrive/sdk --workspace=@gigadrive/commons --workspace=@gigadrive/network-config --workspace=@gigadrive/build-utils --workspace=@gigadrive/harmony --workspace=gigadrive && node scripts/update-canary-tags.mjs && changeset tag",
1616
"ci:version": "changeset version && pnpm install --no-frozen-lockfile",
1717
"clean": "turbo run clean",
1818
"dev": "turbo run dev",

0 commit comments

Comments
 (0)