Skip to content

Commit d436eb0

Browse files
committed
Add permissions and GitHub token setup for package publishing in release workflow
1 parent 4911951 commit d436eb0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/create-release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ on:
2929
jobs:
3030
release-it:
3131
runs-on: ubuntu-latest
32+
permissions:
33+
contents: write
34+
packages: write
3235
steps:
3336
- uses: tibdex/github-app-token@v1
3437
id: generate-token
@@ -55,8 +58,10 @@ jobs:
5558
- name: set NPM Token
5659
run: |
5760
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
61+
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc
5862
env:
5963
NPM_TOKEN: ${{ secrets.NPM_TOKEN_NEOLUTION }}
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6065

6166
- name: run release-it
6267
run: |
@@ -81,3 +86,6 @@ jobs:
8186
yarn release-it "${params[@]}"
8287
env:
8388
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
89+
90+
- name: publish to github packages
91+
run: npm publish --registry=https://npm.pkg.github.com/

0 commit comments

Comments
 (0)