Skip to content

Commit f522b06

Browse files
authored
Merge pull request #285 from ringcentral/debugPublishIssue
Trusted publishing for npm packages
2 parents 72dfa2b + 38ad5ca commit f522b06

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/release-with-tag.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ jobs:
1212
node-version: [22.x]
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v1
17+
uses: actions/setup-node@v4
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
registry-url: "https://registry.npmjs.org"
21+
- name: Upgrade npm for trusted publishing compatibility
22+
run: |
23+
npm i -g npm@^11.5.1
24+
npm --version
2125
- run: yarn install
2226
- run: DEBUG=eslint:cli-engine npm run lint:all
2327
- run: npm run build
@@ -28,25 +32,28 @@ jobs:
2832
runs-on: ubuntu-latest # Firefox in it
2933
strategy:
3034
matrix:
31-
node-version: [22.x]
35+
node-version: [22.14.0]
3236
permissions:
3337
contents: write # for release
38+
id-token: write # for npm trusted publishing (OIDC)
3439
steps:
3540
- name: Checkout
36-
uses: actions/checkout@v2
41+
uses: actions/checkout@v4
3742
- name: Use Node.js ${{ matrix.node-version }}
38-
uses: actions/setup-node@v1
43+
uses: actions/setup-node@v4
3944
with:
4045
node-version: ${{ matrix.node-version }}
4146
registry-url: "https://registry.npmjs.org"
47+
- name: Upgrade npm for trusted publishing compatibility
48+
run: |
49+
npm i -g npm@^11.5.1
50+
npm --version
4251
- run: yarn install
4352
- run: npm run build
4453
- run: git status && git stash
4554
- run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
4655
- run: npm run publish:release -- $TAG --yes
4756
if: ${{ env.TAG != '' && !contains(env.TAG, '/') && github.repository == 'ringcentral/ringcentral-js' }}
48-
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5057
- name: Release
5158
if: ${{ env.TAG != '' && !contains(env.TAG, '/') && github.repository == 'ringcentral/ringcentral-js' }}
5259
uses: softprops/action-gh-release@v1

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v2
1414
- name: Use Node.js ${{ matrix.node-version }}
15-
uses: actions/setup-node@v1
15+
uses: actions/setup-node@v4
1616
with:
1717
node-version: ${{ matrix.node-version }}
1818
registry-url: "https://registry.npmjs.org"
19+
- name: npm registry connectivity debug
20+
run: npm ping --registry=https://registry.npmjs.org
1921
- run: yarn install
2022
- run: DEBUG=eslint:cli-engine npm run lint:all
2123
- run: npm run build

0 commit comments

Comments
 (0)