publish 'auth-basic' plugin by @morhag90 #21
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: npm publish | |
run-name: publish '${{ inputs.plugin }}' plugin by @${{ github.actor }} | |
on: | |
workflow_dispatch: | |
inputs: | |
plugin: | |
description: "Plugin to be published" | |
type: choice | |
required: true | |
options: | |
- "auth-basic" | |
- "auth-core" | |
- "auth-jwt" | |
- "broker-kafka" | |
- "ci-github-actions" | |
- "db-mongo" | |
- "db-mysql" | |
- "db-postgres" | |
- "deployment-helm-chart" | |
- "formatter-prettier" | |
- "nestjs-nats" | |
- "swagger-apibody" | |
publish: | |
description: "Publish package" | |
type: boolean | |
required: true | |
default: false | |
jobs: | |
publish: | |
if: ${{ github.event.inputs.publish }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies and build 🔧 | |
run: npm ci && npm run build | |
working-directory: plugins/${{ github.event.inputs.plugin }} | |
# if the branch is the default branch, the latest tag is applied | |
- name: Publish package on NPM [latest] 📦 | |
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
run: npm publish --access public | |
working-directory: plugins/${{ github.event.inputs.plugin }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# if the branch is not the default branch, the beta tag is applied | |
- name: Publish package on NPM [beta] 📦 | |
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) | |
run: npm publish --access public --tag beta | |
working-directory: plugins/${{ github.event.inputs.plugin }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |