Publish Package #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Package | |
on: | |
release: | |
types: | |
- released | |
workflow_dispatch: | |
inputs: | |
npm: | |
default: "yes" | |
description: Publish to NPM? | |
required: true | |
gpr: | |
default: "yes" | |
description: Publish to GPR? | |
required: true | |
permissions: | |
contents: read | |
jobs: | |
prepare: | |
name: Prepare source code | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' || github.event.inputs.npm == 'yes' || github.event.inputs.gpr == 'yes' | |
steps: | |
- name: Prepare source | |
uses: myrotvorets/composite-actions/node-prepublish@master | |
publish: | |
name: Publish package (${{ matrix.registry }}) | |
runs-on: ubuntu-latest | |
needs: prepare | |
permissions: | |
contents: read | |
packages: write | |
statuses: write | |
strategy: | |
matrix: | |
registry: | |
- npm | |
- gpr | |
include: | |
- registry: npm | |
secret: NPM_TOKEN | |
registry_url: https://registry.npmjs.org/ | |
- registry: gpr | |
secret: GITHUB_TOKEN | |
registry_url: https://npm.pkg.github.com/ | |
steps: | |
- name: Publish package | |
uses: myrotvorets/composite-actions/node-publish@master | |
with: | |
node-auth-token: ${{ secrets[matrix.secret] }} | |
registry-url: ${{ matrix.registry_url }} | |
if: github.event.inputs[matrix.registry] == 'yes' || github.event_name == 'release' |