NPM Publish #11
Workflow file for this run
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: NPM Publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: "Branch to publish" | |
| required: true | |
| default: "develop" | |
| dry_run: | |
| description: "Perform a dry run of the npm publish" | |
| required: false | |
| default: true | |
| type: boolean | |
| version_type: | |
| description: "Type of version bump (prerelease or specific version like 1.2.3-dev.0)" | |
| required: false | |
| default: "prerelease" | |
| type: string | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ui | |
| shell: bash | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.branch }} | |
| - name: Install deps | |
| uses: ./.github/actions/cached-ui-deps | |
| - name: Bump version | |
| if: github.event.inputs.version_type | |
| run: | | |
| if [ "${{ github.event.inputs.version_type }}" = "prerelease" ]; then | |
| npm version prerelease --preid=dev --no-git-tag-version | |
| else | |
| npm version ${{ github.event.inputs.version_type }} --no-git-tag-version | |
| fi | |
| - name: Publish NPM package | |
| run: | | |
| if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then | |
| npm publish --provenance --access public --dry-run | |
| else | |
| npm publish --provenance --access public | |
| fi | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |