Skip to content

Commit fc86e1f

Browse files
authored
Configure GitHub workflow to use trusted publishing (#78)
* Configure GitHub workflow to use trusted publishing * Upgrade @configcat/sdk to v1.0.2 * Bump version
1 parent 9045db2 commit fc86e1f

File tree

3 files changed

+53
-25
lines changed

3 files changed

+53
-25
lines changed

.github/workflows/react-ci.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ on:
88
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
99
pull_request:
1010
branches: [ main ]
11-
11+
1212
workflow_dispatch:
13-
13+
1414
jobs:
1515
test:
1616
runs-on: ubuntu-latest
1717
name: Test with react-scripts and report coverage
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v5
2020

21-
- uses: actions/setup-node@v2
21+
- uses: actions/setup-node@v5
2222
with:
2323
node-version: 14
24-
24+
2525
- name: Install dependencies
2626
run: |
2727
npm install codecov -g
2828
npm install
29-
29+
3030
- name: Build
3131
run: |
3232
npm run build
33-
33+
3434
- name: Test
3535
run: npm run test -- --coverage
3636

@@ -44,27 +44,32 @@ jobs:
4444
with:
4545
name: npm-package
4646
path: configcat-react*.tgz
47-
47+
4848
publish:
4949
needs: [test]
50-
runs-on: ubuntu-latest
5150
if: startsWith(github.ref, 'refs/tags')
51+
runs-on: ubuntu-latest
52+
permissions:
53+
id-token: write # Required for OIDC (see also https://docs.npmjs.com/trusted-publishers)
54+
contents: read
5255
steps:
53-
- uses: actions/checkout@v2
56+
- uses: actions/checkout@v5
5457

55-
- uses: actions/setup-node@v2
58+
- uses: actions/setup-node@v5
5659
with:
57-
node-version: 14
60+
node-version: 22
5861
registry-url: 'https://registry.npmjs.org'
59-
62+
63+
# Ensure npm 11.5.1 or later is installed
64+
- name: Update npm
65+
run: npm install -g npm@latest
66+
6067
- name: Install dependencies
6168
run: npm install
62-
69+
6370
- name: Build
6471
run: |
6572
npm run build
6673
6774
- name: 🚀Publish
6875
run: npm publish
69-
env:
70-
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "configcat-react",
3-
"version": "5.0.1",
3+
"version": "5.0.2",
44
"scripts": {
55
"build": "npm run build:esm && npm run build:cjs",
66
"build:esm": "tsc -p tsconfig.build.esm.json && gulp esm",
@@ -33,7 +33,7 @@
3333
"homepage": "https://configcat.com",
3434
"license": "MIT",
3535
"dependencies": {
36-
"@configcat/sdk": "^1.0.1",
36+
"@configcat/sdk": "^1.0.2",
3737
"tslib": "^2.4.1"
3838
},
3939
"peerDependencies": {

0 commit comments

Comments
 (0)