Skip to content

Commit c205aac

Browse files
committed
Use npm trusted publishing
1 parent e6ca972 commit c205aac

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,24 @@ jobs:
1313
release:
1414
needs: test
1515
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
id-token: write
1619
steps:
1720
- uses: actions/checkout@v2
18-
- uses: ./.github/actions/setup-test-env
19-
- id: npm-publish
20-
name: Publish requirefire to npm
21-
uses: JS-DevTools/npm-publish@v1
21+
- uses: actions/setup-node@v4
2222
with:
23-
token: ${{ secrets.NPM_TOKEN }}
24-
access: public
23+
node-version: 24
24+
- uses: ./.github/actions/setup-test-env
25+
- name: Update npm to latest
26+
run: npm install -g npm@latest
27+
- name: Publish requirefire to npm
28+
run: npm publish --access public
29+
- name: Get version
30+
id: version
31+
run: echo "version=$(node -p 'require(\"./package.json\").version')" >> "$GITHUB_OUTPUT"
2532
- name: Publish Release to github
2633
uses: softprops/action-gh-release@v1
27-
if: ${{ steps.npm-publish.outputs.type != 'none' }}
2834
with:
29-
tag_name: ${{ steps.npm-publish.outputs.version }}
30-
generate_release_notes: true
35+
tag_name: ${{ steps.version.outputs.version }}
36+
generate_release_notes: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/gadget-inc/requirefire.git"
8+
"url": "git+https://github.com/gadget-inc/requirefire.git"
99
},
1010
"publishConfig": {
1111
"access": "public"

0 commit comments

Comments
 (0)