File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616jobs :
1717 publish-npm :
1818 runs-on : ubuntu-latest
19+ environment :
20+ name : ${{ matrix.environment }}
21+ url : ${{ steps.environment.outputs.url }}
1922 strategy :
2023 fail-fast : false
2124 matrix :
2225 include :
2326 - registry-url : " https://npm.pkg.github.com"
27+ environment : npm-gpr
2428 extra-args : " "
2529 - registry-url : " https://registry.npmjs.org"
30+ environment : npmjs
2631 extra-args : " --provenance --access public"
2732 steps :
2833 - name : Checkout
5459
5560 - name : Publish
5661 run : npm publish ${{ matrix.extra-args }}
62+
63+ - name : Set environment output
64+ id : environment
65+ run : |
66+ if [[ "${{ matrix.environment }}" == "npm-gpr" ]]; then
67+ url="https://github.com/${{ github.repository }}/pkgs/npm/${{ github.event.repository.name }}"
68+ elif [[ "${{ matrix.environment }}" == "npmjs" ]]; then
69+ package_name=$(node -p "require('./package.json').name")
70+ url="https://www.npmjs.com/package/${package_name}"
71+ fi
72+ echo "url=${url}" >> "${GITHUB_OUTPUT}"
You can’t perform that action at this time.
0 commit comments