3.4.1 #158
Workflow file for this run
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 | |
on: | |
release: | |
types: [published] | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup variables | |
id: variables | |
shell: bash | |
env: | |
TAG_NAME: ${{ github.event.release.tag_name }} | |
run: | | |
# If the git tag name contains the word "beta" then make this a beta release in the npm registry | |
if [[ "${TAG_NAME}" =~ beta ]]; then | |
echo "NPM_TAG=--tag beta" >> $GITHUB_OUTPUT | |
fi | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
registry-url: https://registry.npmjs.org/ | |
- name: Publish to npm | |
run: | | |
npm ci | |
npm run build | |
echo "Publishing package: npm publish --access public ${TAG_NAME}" | |
npm publish --access public ${TAG_NAME} | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
TAG_NAME: ${{ steps.variables.outputs.NPM_TAG }} |