Skip to content

Commit 3543083

Browse files
authored
Configure GitHub workflow to use trusted publishing (#11)
* Configure GitHub workflow to use trusted publishing * Specify repo URL * Bump version
1 parent c715aab commit 3543083

File tree

3 files changed

+24
-15
lines changed

3 files changed

+24
-15
lines changed

.github/workflows/configcat-publicapi-node-ci.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,49 @@ on:
66
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
77
pull_request:
88
branches: [ master ]
9-
9+
1010
workflow_dispatch:
11-
11+
1212
jobs:
1313
test:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717

18-
- uses: actions/setup-node@v4
18+
- uses: actions/setup-node@v5
1919
with:
2020
node-version: 18
2121

2222
- name: Install dependencies
2323
run: npm install
24-
24+
2525
- name: Build
2626
run: npm run build
2727

2828
publish:
2929
needs: test
30-
runs-on: ubuntu-latest
3130
if: startsWith(github.ref, 'refs/tags')
31+
runs-on: ubuntu-latest
32+
permissions:
33+
id-token: write # Required for OIDC (see also https://docs.npmjs.com/trusted-publishers)
34+
contents: read
3235
steps:
33-
- uses: actions/checkout@v4
36+
- uses: actions/checkout@v5
3437

35-
- uses: actions/setup-node@v4
38+
- uses: actions/setup-node@v5
3639
with:
37-
node-version: 18
40+
node-version: 22
3841
registry-url: 'https://registry.npmjs.org'
3942

43+
# Ensure npm 11.5.1 or later is installed
44+
- name: Update npm
45+
run: npm install -g npm@latest
46+
4047
- name: Install dependencies
4148
run: npm install
42-
49+
4350
- name: Build
4451
run: npm run build
4552

4653
- name: 🚀Publish
4754
run: npm publish
48-
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "configcat-publicapi-node-client",
3-
"version": "3.0.2",
3+
"version": "3.0.3",
44
"description": "NodeJS client for configcat-publicapi-node-client",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -16,5 +16,9 @@
1616
"@types/bluebird": "^3.5.33",
1717
"@types/node": "^12",
1818
"typescript": "^4.0"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "https://github.com/configcat/configcat-publicapi-node-client"
1923
}
2024
}

0 commit comments

Comments
 (0)