Skip to content

Commit c7a9611

Browse files
committed
chore: update to use OIDC publishing
this commit will also update Node.js version to 24.x and install npm 11.6.2 in workflows
1 parent 0c1173e commit c7a9611

File tree

2 files changed

+46
-49
lines changed

2 files changed

+46
-49
lines changed

.github/workflows/manual-publish.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/release-please.yml

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@ on:
44
push:
55
branches:
66
- main
7+
workflow_dispatch:
8+
inputs:
9+
dry-run:
10+
description: 'Is this a dry run. If so no package will be published.'
11+
type: boolean
12+
required: true
13+
prerelease:
14+
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
15+
type: boolean
16+
required: true
717

818
jobs:
919
release-please:
20+
if: github.event_name == 'push'
1021
runs-on: ubuntu-latest
1122
outputs:
1223
release_created: ${{ steps.release.outputs.release_created }}
@@ -19,23 +30,22 @@ jobs:
1930
publish-package:
2031
runs-on: ubuntu-latest
2132
needs: ['release-please']
33+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
2234
permissions:
2335
id-token: write
2436
contents: write
25-
if: ${{ needs.release-please.outputs.release_created == 'true' }}
2637
steps:
2738
- uses: actions/checkout@v4
2839

2940
- uses: actions/setup-node@v4
3041
with:
31-
node-version: 20.x
42+
node-version: 24.x
3243
registry-url: 'https://registry.npmjs.org'
3344

34-
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
35-
name: 'Get NPM token'
36-
with:
37-
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
38-
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN'
45+
- name: Update NPM
46+
shell: bash
47+
# Must be greater than 11.5.1 for OIDC.
48+
run: npm install -g npm@11.6.2
3949

4050
- name: Install Dependencies
4151
run: npm install
@@ -56,3 +66,32 @@ jobs:
5666
uses: ./.github/actions/publish-docs
5767
with:
5868
github_token: ${{ secrets.GITHUB_TOKEN }}
69+
70+
manual-publish-package:
71+
runs-on: ubuntu-latest
72+
if: github.event_name == 'workflow_dispatch'
73+
permissions:
74+
id-token: write
75+
contents: write
76+
steps:
77+
- uses: actions/checkout@v4
78+
79+
- uses: actions/setup-node@v4
80+
with:
81+
node-version: 24.x
82+
registry-url: 'https://registry.npmjs.org'
83+
84+
- name: Update NPM
85+
shell: bash
86+
# Must be greater than 11.5.1 for OIDC.
87+
run: npm install -g npm@11.6.2
88+
89+
- name: Install Dependencies
90+
run: npm install
91+
92+
- id: publish-npm
93+
name: Publish NPM Package
94+
uses: ./.github/actions/publish-npm
95+
with:
96+
dry-run: ${{ inputs.dry-run }}
97+
prerelease: ${{ inputs.prerelease }}

0 commit comments

Comments
 (0)