Skip to content

Commit 19d9511

Browse files
authored
Merge pull request #329 from sparksuite/use-trusted-publishing
Use trusted publishing for npm package
2 parents 5dfb1a3 + 4397f15 commit 19d9511

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ jobs:
9191
- test
9292
- verify-website
9393
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
94+
permissions:
95+
id-token: write
96+
contents: read
9497
steps:
9598
- uses: actions/checkout@v3
9699
- name: Use Node.js
@@ -109,9 +112,14 @@ jobs:
109112
restore-keys: |
110113
${{ runner.os }}-yarn-
111114
- run: yarn dev
112-
- run: yarn publish
113-
env:
114-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
115+
- run: |
116+
if [[ "$GITHUB_REF" =~ -alpha ]]; then
117+
npm publish --tag alpha
118+
elif [[ "$GITHUB_REF" =~ -beta ]]; then
119+
npm publish --tag beta
120+
else
121+
npm publish
122+
fi
115123
deploy:
116124
name: Deploy to GitHub Pages
117125
runs-on: ubuntu-latest

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-accessible-dropdown-menu-hook",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "A simple Hook for creating fully accessible dropdown menus in React",
55
"main": "dist/use-dropdown-menu.js",
66
"types": "dist/use-dropdown-menu.d.ts",

0 commit comments

Comments
 (0)