Skip to content

Commit 253c765

Browse files
committed
publish workflow using OIDC
1 parent 1159b93 commit 253c765

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
name: Publish Packages to npm
1+
name: Publish to NPM
22

33
on:
44
push:
55
tags:
66
- 'v*' # Run on any tag that starts with v (e.g., v1.0.0)
77

8+
9+
permissions:
10+
id-token: write # Required for OIDC
11+
contents: read
12+
813
jobs:
914
publish:
1015
runs-on: ubuntu-latest
@@ -15,9 +20,12 @@ jobs:
1520
- name: Setup Node.js
1621
uses: actions/setup-node@v4
1722
with:
18-
node-version: '18'
19-
registry-url: 'https://registry.npmjs.org/'
20-
scope: '@beekeeperstudio'
23+
node-version: '20'
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
# Ensure npm 11.5.1 or later is installed
27+
- name: Update npm
28+
run: npm install -g npm@latest
2129

2230
- name: Get tag version
2331
id: get_version
@@ -30,7 +38,7 @@ jobs:
3038
run: |
3139
yarn version --new-version $VERSION --no-git-tag-version
3240
33-
- name: Build packages
41+
- name: Build package
3442
run: yarn build
3543

3644
- name: Check if beta version
@@ -46,25 +54,8 @@ jobs:
4654
4755
- name: Publish package (beta)
4856
if: env.IS_BETA == 'true'
49-
run: yarn publish --access public --non-interactive --tag beta
50-
env:
51-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57+
run: npm publish --access public --tag beta
5258

5359
- name: Publish package (stable)
5460
if: env.IS_BETA == 'false'
55-
run: yarn publish --access public --non-interactive
56-
env:
57-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
58-
59-
# Create GitHub release for this version
60-
- name: Create GitHub Release
61-
uses: softprops/action-gh-release@v1
62-
with:
63-
name: Release ${{ env.VERSION }}
64-
body: |
65-
# Beekeeper Studio Plugin v${{ env.VERSION }}
66-
67-
Published package:
68-
- @beekeeperstudio/plugin@${{ env.VERSION }}
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
run: npm publish --access public

0 commit comments

Comments
 (0)