Skip to content

Commit 769fd92

Browse files
committed
chore: release to GitHub
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent ddb4753 commit 769fd92

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

.github/workflows/release.yml

+21-10
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ jobs:
7878
- name: git push back
7979
run: git push --follow-tags
8080

81-
publish-NPMJS:
81+
publish-package:
8282
needs:
8383
- "bump"
84-
name: publish NPMJS
84+
name: publish package
8585
runs-on: ubuntu-latest
8686
timeout-minutes: 30
8787
env:
88-
NPMJS_RELEASE_TAG: ${{ github.event.inputs.prerelease == 'true' && 'unstable-prerelease' || 'latest' }}
88+
PACKAGE_RELEASE_TAG: ${{ github.event.inputs.prerelease == 'true' && 'unstable-prerelease' || 'latest' }}
8989
steps:
9090
- name: Checkout code
9191
# see https://github.com/actions/checkout
@@ -100,16 +100,27 @@ jobs:
100100
- name: install build tools
101101
run: npm i --ignore-scripts --include=optional --loglevel=silly
102102
# no explicit npm build. if a build is required, it should be configured as prepublish/prepublishOnly script of npm.
103-
- name: login to NPMJS
104-
run: npm config set "//registry.npmjs.org/:_authToken=$NPMJS_AUTH_TOKEN"
103+
- name: login to registries
104+
run: |
105+
npm config set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
106+
npm config set "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN"
105107
env:
106-
NPMJS_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
107-
- name: publish to NPMJS as "${{ env.NPMJS_RELEASE_TAG }}"
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
110+
- name: publish to NPMJS as "${{ env.PACKAGE_RELEASE_TAG }}"
111+
run: >
112+
npm publish
113+
--@cyclonedx:registry='https://registry.npmjs.org'
114+
--provenance
115+
--access public
116+
--tag "$PACKAGE_RELEASE_TAG"
117+
- name: publish to GitHub as "${{ env.PACKAGE_RELEASE_TAG }}"
108118
run: >
109-
npm publish
119+
npm publish
120+
--@cyclonedx:registry='https://npm.pkg.github.com'
110121
--provenance
111122
--access public
112-
--tag "$NPMJS_RELEASE_TAG"
123+
--tag "$PACKAGE_RELEASE_TAG"
113124
- name: pack release result
114125
run: |
115126
mkdir -p "$PACKED_DIR"
@@ -125,7 +136,7 @@ jobs:
125136
release-GH:
126137
needs:
127138
- "bump"
128-
- "publish-NPMJS"
139+
- "publish-package"
129140
name: publish GitHub
130141
runs-on: ubuntu-latest
131142
timeout-minutes: 30

0 commit comments

Comments
 (0)