Skip to content

Commit

Permalink
prepare to publish with provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
iamnapo committed May 26, 2024
1 parent f84b74d commit 712b0c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to GitHub registry
name: Publish

on:
release:
Expand All @@ -7,12 +7,24 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: 🏗 Run replace-in-file
run: npx replace-in-file "eslint-config-iamnapo" "@iamnapo/eslint-config-iamnapo" package.json
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: "https://registry.npmjs.org"

- name: 🚀 Release to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: ⎔ Setup node
uses: actions/setup-node@v4
Expand All @@ -21,8 +33,10 @@ jobs:
registry-url: "https://npm.pkg.github.com"
scope: "@iamnapo"

- name: 🚀 Release
- name: 🏗 Run replace-in-file
run: npx replace-in-file "eslint-config-iamnapo" "@iamnapo/eslint-config-iamnapo" package.json

- name: 🚀 Release to GitHub
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,9 @@
},
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public",
"provenance": true
}
}

0 comments on commit 712b0c3

Please sign in to comment.