Skip to content

Commit 1acc0fc

Browse files
committed
Enhance release workflow: Publish to GitHub packages
1 parent 0ee19a3 commit 1acc0fc

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/create-release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
pre_release:
1616
type: choice
17-
description: Pre Rlease?
17+
description: Pre Release?
1818
options:
1919
- stable
2020
- alpha
@@ -24,6 +24,9 @@ on:
2424
jobs:
2525
release-it:
2626
runs-on: ubuntu-latest
27+
permissions:
28+
contents: write
29+
packages: write
2730
steps:
2831
- uses: tibdex/github-app-token@v2
2932
id: generate-token
@@ -50,8 +53,10 @@ jobs:
5053
- name: set NPM Token
5154
run: |
5255
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
56+
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc
5357
env:
5458
NPM_TOKEN: ${{ secrets.NPM_TOKEN_NEOLUTION }}
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5560

5661
- name: run release-it
5762
run: |
@@ -72,3 +77,6 @@ jobs:
7277
yarn release-it "${params[@]}"
7378
env:
7479
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
80+
81+
- name: publish to github packages
82+
run: npm publish --registry=https://npm.pkg.github.com/

0 commit comments

Comments
 (0)