@@ -78,14 +78,14 @@ jobs:
78
78
- name : git push back
79
79
run : git push --follow-tags
80
80
81
- publish-NPMJS :
81
+ publish-package :
82
82
needs :
83
83
- " bump"
84
- name : publish NPMJS
84
+ name : publish package
85
85
runs-on : ubuntu-latest
86
86
timeout-minutes : 30
87
87
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' }}
89
89
steps :
90
90
- name : Checkout code
91
91
# see https://github.com/actions/checkout
@@ -100,16 +100,27 @@ jobs:
100
100
- name : install build tools
101
101
run : npm i --ignore-scripts --include=optional --loglevel=silly
102
102
# 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"
105
107
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 }}"
108
118
run : >
109
- npm publish
119
+ npm publish
120
+ --@cyclonedx:registry='https://npm.pkg.github.com'
110
121
--provenance
111
122
--access public
112
- --tag "$NPMJS_RELEASE_TAG "
123
+ --tag "$PACKAGE_RELEASE_TAG "
113
124
- name : pack release result
114
125
run : |
115
126
mkdir -p "$PACKED_DIR"
@@ -125,7 +136,7 @@ jobs:
125
136
release-GH :
126
137
needs :
127
138
- " bump"
128
- - " publish-NPMJS "
139
+ - " publish-package "
129
140
name : publish GitHub
130
141
runs-on : ubuntu-latest
131
142
timeout-minutes : 30
0 commit comments