Skip to content

Commit d0d24c7

Browse files
authored
Use trusted publishing (#13)
1 parent ac8cd43 commit d0d24c7

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@ on:
77
type: string
88
required: true
99
description: Publishing version (tag name)
10+
dry-run:
11+
type: boolean
12+
required: false
13+
default: false
14+
description: Dry run
15+
16+
permissions:
17+
id-token: write # Required for OIDC (Trusted Publishing)
18+
contents: read
1019

1120
jobs:
1221
publish:
1322
runs-on: ubuntu-latest
23+
environment: npmjs
1424
steps:
1525
- name: Checkout devextreme-exceljs-fork repository
1626
uses: actions/checkout@v4
@@ -20,10 +30,14 @@ jobs:
2030
- name: Setup Node.js
2131
uses: actions/setup-node@v4
2232
with:
23-
node-version: '18'
33+
node-version: '24'
2434
cache: 'npm'
2535
registry-url: 'https://registry.npmjs.org'
2636

37+
# npm version 11.5.1 or later is required to use Trusted Publishing
38+
- name: NPM Version
39+
run: npm --version
40+
2741
- name: Install dependencies
2842
run: npm ci
2943

@@ -52,5 +66,10 @@ jobs:
5266
5367
- name: Publish to NPM
5468
env:
55-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56-
run: npm publish
69+
DRY_RUN: "${{ inputs.dry-run }}"
70+
run: |
71+
if [ "$DRY_RUN" = true ]; then
72+
npm publish --dry-run
73+
else
74+
npm publish
75+
fi

0 commit comments

Comments
 (0)