Publish Package to NPM #53
This file contains hidden or 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 to NPM | |
on: | |
workflow_dispatch: | |
inputs: | |
package-name: | |
description: 'Package to publish' | |
required: true | |
type: choice | |
options: | |
- authorization | |
- authors-info | |
- color-picker | |
- comments | |
- cover-image | |
- cross-collection | |
- custom-version-view | |
- field-type-components-override | |
- icon-select | |
- quickfilter | |
- right-panel | |
- reset-list-view | |
version-type: | |
description: 'Version to bump: patch (1.0.0 -> 1.0.1), minor (1.0.0 -> 1.1.0), major (1.0.0 -> 2.0.0)' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Validate package exists | |
run: | | |
if [ ! -d "packages/${{ inputs.package-name }}" ]; then | |
echo "Error: Package ${{ inputs.package-name }} does not exist" | |
exit 1 | |
fi | |
if [ ! -f "packages/${{ inputs.package-name }}/package.json" ]; then | |
echo "Error: package.json not found in packages/${{ inputs.package-name }}" | |
exit 1 | |
fi | |
echo "Package ${{ inputs.package-name }} validated successfully" | |
publish: | |
needs: validate | |
uses: ./.github/workflows/publish-plugin-template.yaml | |
with: | |
plugin-name: ${{ inputs.package-name }} | |
version-type: ${{ inputs.version-type }} | |
secrets: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |