Skip to content

Commit cc8400b

Browse files
committed
ci: use npm trusted publishing
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
1 parent 0ef1cb9 commit cc8400b

1 file changed

Lines changed: 28 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,49 @@ on:
77
description: Type of version upgrade (patch, minor, major)
88
required: true
99
default: patch
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
publish_existing:
16+
description: Publish the version already on master without changing it
17+
required: true
18+
default: false
19+
type: boolean
20+
21+
permissions:
22+
contents: write
23+
id-token: write
1024

1125
jobs:
1226
release:
1327
runs-on: ubuntu-latest
1428
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v2-beta
29+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
1731
with:
18-
node-version: 12
32+
node-version: 22
1933
registry-url: https://registry.npmjs.org/
34+
package-manager-cache: false
2035

2136
- name: Setup git
37+
if: inputs.publish_existing == false
2238
run: |-
2339
git config --global user.name "github-actions[bot]"
2440
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
25-
26-
- run: npm version ${{ github.event.inputs.upgrade }}
2741
28-
- run: git push
29-
- run: git push --tags
42+
- name: Bump version
43+
if: inputs.publish_existing == false
44+
run: npm version ${{ inputs.upgrade }}
45+
46+
- name: Push version
47+
if: inputs.publish_existing == false
48+
run: |-
49+
git push
50+
git push --tags
3051
3152
- run: npm publish
32-
env:
33-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3453

3554
- name: Prepare build
3655
run: npm i -g pkg

0 commit comments

Comments
 (0)