Skip to content

Publish Packages Manually #18

Publish Packages Manually

Publish Packages Manually #18

name: Publish Packages Manually
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: false
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch name'
required: true
type: choice
options:
- 'main'
- 'dev'
publish_option:
description: 'Select package(s) to publish'
required: true
type: choice
options:
- 'common'
- 'client'
- 'all'
jobs:
show-inputs:
runs-on: ubuntu-latest
steps:
- name: Print inputs
run: |
echo "Checkout branch: ${{ github.event.inputs.branch }}"
echo "Publish packages: ${{ github.event.inputs.publish_option }}"
publish-common:
name: Publish Common Package
runs-on: ubuntu-latest
if: >-
((github.event.inputs.publish_option == 'common') || (github.event.inputs.publish_option == 'all'))
steps:
- name: Checkout all files
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Publish the package to npmjs
id: build_image
uses: ./.github/actions/publish-common
with:
npm_access_token: ${{ secrets.NPM_ACCESS_TOKEN }}
publish-client:
name: Publish Client Package
runs-on: ubuntu-latest
if: >-
((github.event.inputs.publish_option == 'client') || (github.event.inputs.publish_option == 'all'))
steps:
- name: Checkout all files
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Publish the package to npmjs
id: build_image
uses: ./.github/actions/publish-client
with:
npm_access_token: ${{ secrets.NPM_ACCESS_TOKEN }}