Package Publish #71
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: Package Publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| beta: | |
| description: Beta release | |
| required: true | |
| type: boolean | |
| relno: | |
| description: Release No. | |
| required: false | |
| default: 1 | |
| type: number | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup registry | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Set beta version | |
| if: ${{ inputs.beta }} | |
| run: | | |
| version=$(npm run env | grep npm_package_version | cut -d = -f 2) | |
| npm version --no-git-tag-version --allow-same-version $version-beta.${{ inputs.relno }} | |
| - name: Publish package | |
| run: | | |
| [[ ${{ inputs.beta }} != false ]] && tag=beta || tag=latest | |
| echo tag: $tag | |
| npm publish --access public --tag $tag | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |