Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/__call-update-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ on:
jobs:
publish-npm:
runs-on: ubuntu-latest
environment:
name: ${{ matrix.environment }}
url: ${{ steps.environment.outputs.url }}
strategy:
fail-fast: false
matrix:
include:
- registry-url: "https://npm.pkg.github.com"
environment: npm-gpr
extra-args: ""
- registry-url: "https://registry.npmjs.org"
environment: npmjs
extra-args: "--provenance --access public"
steps:
- name: Checkout
Expand Down Expand Up @@ -54,3 +59,14 @@ jobs:

- name: Publish
run: npm publish ${{ matrix.extra-args }}

- name: Set environment output
id: environment
run: |
if [[ "${{ matrix.environment }}" == "npm-gpr" ]]; then
url="https://github.com/${{ github.repository }}/pkgs/npm/${{ github.event.repository.name }}"
elif [[ "${{ matrix.environment }}" == "npmjs" ]]; then
package_name=$(node -p "require('./package.json').name")
url="https://www.npmjs.com/package/${package_name}"
fi
echo "url=${url}" >> "${GITHUB_OUTPUT}"