Skip to content

Commit e6d04d2

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

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,23 @@ 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: 20
24+
registry-url: "https://registry.npmjs.org"
25+
- uses: ./.github/actions/setup-test-env
26+
- name: Publish requirefire to npm
27+
run: npm publish --provenance --access public
28+
- name: Get version
29+
id: version
30+
run: echo "version=$(node -p 'require(\"./package.json\").version')" >> "$GITHUB_OUTPUT"
2531
- name: Publish Release to github
2632
uses: softprops/action-gh-release@v1
27-
if: ${{ steps.npm-publish.outputs.type != 'none' }}
2833
with:
29-
tag_name: ${{ steps.npm-publish.outputs.version }}
30-
generate_release_notes: true
34+
tag_name: ${{ steps.version.outputs.version }}
35+
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)