5252 - name : Configure Git
5353 # needed for push back of changes
5454 run : |
55- set -ex
55+ set -eux
5656 git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
5757 git config --local user.name "${GITHUB_ACTOR}"
5858 - name : Setup Node.js ${{ env.NODE_ACTIVE_LTS }}
6464 - name : bump VERSION
6565 id : bump
6666 run : |
67- set -ex
68- VERSION="$(npm version "$NPMV_NEWVERSION" --message "$NPMV_MESSAGE" --preid "$NPMV_PREID")"
67+ set -eux
68+ COMMIT_SIG="Signed-off-by: $(git config user.name) <$(git config user.email)>"
69+ VERSION="$( npm version "$NPMV_NEWVERSION" --message "$NPMV_MESSAGE"$'\n\n'"$COMMIT_SIG" --preid "$NPMV_PREID" )"
6970 echo "::debug::new version = $VERSION"
7071 VERSION_PLAIN="${VERSION:1}" # remove 'v' prefix
7172 echo "::debug::plain version = $VERSION_PLAIN"
@@ -78,14 +79,14 @@ jobs:
7879 - name : git push back
7980 run : git push --follow-tags
8081
81- publish-NPMJS :
82+ publish-package :
8283 needs :
8384 - " bump"
84- name : publish NPMJS
85+ name : publish package
8586 runs-on : ubuntu-latest
8687 timeout-minutes : 30
8788 env :
88- NPMJS_RELEASE_TAG : ${{ github.event.inputs.prerelease == 'true' && 'unstable-prerelease' || 'latest' }}
89+ PACKAGE_RELEASE_TAG : ${{ github.event.inputs.prerelease == 'true' && 'unstable-prerelease' || 'latest' }}
8990 steps :
9091 - name : Checkout code
9192 # see https://github.com/actions/checkout
@@ -100,16 +101,27 @@ jobs:
100101 - name : install build tools
101102 run : npm i --ignore-scripts --include=optional --loglevel=silly
102103 # 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"
104+ - name : login to registries
105+ run : |
106+ npm config set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
107+ npm config set "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN"
105108 env :
106- NPMJS_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
107- - name : publish to NPMJS as "${{ env.NPMJS_RELEASE_TAG }}"
109+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
110+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
111+ - name : publish to NPMJS as "${{ env.PACKAGE_RELEASE_TAG }}"
112+ run : >
113+ npm publish
114+ --@cyclonedx:registry='https://registry.npmjs.org'
115+ --provenance
116+ --access public
117+ --tag "$PACKAGE_RELEASE_TAG"
118+ - name : publish to GitHub as "${{ env.PACKAGE_RELEASE_TAG }}"
108119 run : >
109- npm publish
120+ npm publish
121+ --@cyclonedx:registry='https://npm.pkg.github.com'
110122 --provenance
111123 --access public
112- --tag "$NPMJS_RELEASE_TAG "
124+ --tag "$PACKAGE_RELEASE_TAG "
113125 - name : pack release result
114126 run : |
115127 mkdir -p "$PACKED_DIR"
@@ -125,7 +137,7 @@ jobs:
125137 release-GH :
126138 needs :
127139 - " bump"
128- - " publish-NPMJS "
140+ - " publish-package "
129141 name : publish GitHub
130142 runs-on : ubuntu-latest
131143 timeout-minutes : 30
0 commit comments