From 5874f4db01a42980b1420a927d562afec25bb37a Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Thu, 23 May 2024 16:20:31 +0200 Subject: [PATCH] chore: release to GitHub Signed-off-by: Jan Kowalleck --- .github/workflows/release.yml | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2afa42d59..f4ff15c19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,14 +78,14 @@ jobs: - name: git push back run: git push --follow-tags - publish-NPMJS: + publish-package: needs: - "bump" - name: publish NPMJS + name: publish package runs-on: ubuntu-latest timeout-minutes: 30 env: - NPMJS_RELEASE_TAG: ${{ github.event.inputs.prerelease == 'true' && 'unstable-prerelease' || 'latest' }} + PACKAGE_RELEASE_TAG: ${{ github.event.inputs.prerelease == 'true' && 'unstable-prerelease' || 'latest' }} steps: - name: Checkout code # see https://github.com/actions/checkout @@ -100,16 +100,27 @@ jobs: - name: install build tools run: npm i --ignore-scripts --include=optional --loglevel=silly # no explicit npm build. if a build is required, it should be configured as prepublish/prepublishOnly script of npm. - - name: login to NPMJS - run: npm config set "//registry.npmjs.org/:_authToken=$NPMJS_AUTH_TOKEN" + - name: login to registries + run: | + npm config set "//registry.npmjs.org/:_authToken=$NPMJS_AUTH_TOKEN" + npm config set "//npm.pkg.github.com/:_authToken==$GH_AUTH_TOKEN" env: + GH_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPMJS_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: publish to NPMJS as "${{ env.NPMJS_RELEASE_TAG }}" + - name: publish to NPMJS as "${{ env.PACKAGE_RELEASE_TAG }}" run: > - npm publish + npm publish + --@cyclonedx:registry='https://registry.npmjs.org' --provenance --access public - --tag "$NPMJS_RELEASE_TAG" + --tag "$PACKAGE_RELEASE_TAG" + - name: publish to GitHub as "${{ env.PACKAGE_RELEASE_TAG }}" + run: > + npm publish + --@cyclonedx:registry='https://npm.pkg.github.com' + --provenance + --access public + --tag "$PACKAGE_RELEASE_TAG" - name: pack release result run: | mkdir -p "$PACKED_DIR" @@ -125,7 +136,7 @@ jobs: release-GH: needs: - "bump" - - "publish-NPMJS" + - "publish-package" name: publish GitHub runs-on: ubuntu-latest timeout-minutes: 30