Skip to content

Commit 195c4b6

Browse files
committed
fix: publish with OIDC
1 parent 9d48278 commit 195c4b6

File tree

2 files changed

+12
-52
lines changed

2 files changed

+12
-52
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
fail-fast: false
22-
matrix:
23-
node: [22]
2422

2523
steps:
2624
- name: Retrieve current Date Time in EST
@@ -35,35 +33,24 @@ jobs:
3533
with:
3634
fetch-depth: 3
3735

38-
- name: Set NodeJS
39-
uses: actions/setup-node@v4
40-
with:
41-
node-version: ${{ matrix.node }}
42-
4336
- name: Install pnpm
4437
uses: pnpm/action-setup@v3
4538
with:
4639
version: 10
4740
run_install: false
4841

49-
- name: Get pnpm store directory
50-
shell: bash
51-
run: |
52-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
53-
54-
- uses: actions/cache@v4
55-
name: Setup pnpm cache
42+
- name: Set NodeJS
43+
uses: actions/setup-node@v4
5644
with:
57-
path: ${{ env.STORE_PATH }}
58-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
59-
restore-keys: |
60-
${{ runner.os }}-pnpm-store-
45+
node-version: 24
46+
cache: 'pnpm'
47+
48+
- run: node --version
49+
- run: pnpm --version
6150

6251
- name: Run pnpm install dependencies
6352
run: pnpm install
6453

65-
- run: pnpm --version
66-
6754
- name: Biome Lint Check
6855
run: pnpm biome:lint:check
6956

.github/workflows/publish-npm-latest.yml renamed to .github/workflows/release.yml

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 🏷️ Lerna Publish NPM Latest
1+
name: 🏷️ Release to NPM
22

33
on:
44
workflow_dispatch:
@@ -30,36 +30,24 @@ jobs:
3030
uses: actions/checkout@v4
3131
with:
3232
fetch-depth: 0
33-
token: ${{ secrets.GITHUB_TOKEN }}
3433

3534
- if: ${{ github.event.pull_request.merged != true && contains('["ghiscoding"]', github.actor) != true }}
3635
name: Exit early when current actor is not allowed to push new release
3736
run: |
3837
echo "Error: Your GitHub username (${{ github.actor }}) is not on the allowed list of admins for this workflow"
3938
exit 1
4039
41-
- name: Set NodeJS
42-
uses: actions/setup-node@v4
43-
with:
44-
registry-url: 'https://registry.npmjs.org/'
45-
node-version: 22
46-
4740
- name: Install pnpm
4841
uses: pnpm/action-setup@v3
4942
with:
5043
version: 10
5144
run_install: false
5245

53-
- name: Get pnpm store directory
54-
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
55-
56-
- name: Setup pnpm cache
57-
uses: actions/cache@v4
46+
- name: Set NodeJS
47+
uses: actions/setup-node@v4
5848
with:
59-
path: ${{ env.STORE_PATH }}
60-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
61-
restore-keys: |
62-
${{ runner.os }}-pnpm-store-
49+
registry-url: 'https://registry.npmjs.org/'
50+
node-version: 24
6351

6452
- name: Run pnpm install dependencies
6553
run: pnpm install
@@ -94,30 +82,15 @@ jobs:
9482
- name: Lerna Version 🏷️
9583
env:
9684
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
98-
NPM_CONFIG_PROVENANCE: true
9985
run: |
10086
git config --global user.name "${{ github.actor }}"
10187
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
102-
pnpm whoami
10388
pnpm exec ${{ env.LERNA_VERSION_QUERY }}
10489
105-
- name: OTP
106-
if: ${{ inputs.dryrun != true }}
107-
uses: step-security/wait-for-secrets@v1
108-
id: wait-for-secrets
109-
with:
110-
secrets: |
111-
OTP:
112-
name: 'OTP to publish package'
113-
description: 'OTP from authenticator app'
114-
11590
- name: Lerna Publish 📦
11691
if: ${{ inputs.dryrun != true }}
11792
env:
11893
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
120-
NPM_CONFIG_PROVENANCE: true
12194
run: |
12295
pnpm exec lerna publish from-package --force-publish --yes --otp ${{ steps.wait-for-secrets.outputs.OTP }}
12396

0 commit comments

Comments
 (0)