Publish Release v0.1.18 JS Library #19
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Release JS Library | |
run-name: Publish Release ${{github.ref_name}} JS Library | |
concurrency: | |
group: ${{github.workflow}}-${{github.ref}} | |
cancel-in-progress: false | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" # ex. v1.0.0 | |
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # ex. v1.1.0-rc1 | |
- "v0.0.1" # used for testing only | |
- "v0.0.1-rc[0-9]+" # used for testing only | |
env: | |
NEW_RELEASE_TAG: ${{github.ref_name}} | |
TEST_RUN: ${{startsWith(github.ref_name, 'v0.0.1')}} | |
jobs: | |
publish-npm: | |
name: Publish NPM Package | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache-dependency-path: package-lock.json | |
- name: Install dependencies | |
run: npm i | |
- name: Build | |
run: npm run build | |
- name: Version Package | |
if: env.TEST_RUN != 'true' | |
working-directory: ./dist | |
run: npm version --new-version "${{env.NEW_RELEASE_TAG}}" --no-git-tag-version | |
# Required for Granular Access Tokens | |
- name: NPM Access Config | |
run: npm config set //registry.npmjs.org/:_authToken ${{secrets.NODE_AUTH_TOKEN}} | |
- name: Release on NPM @latest | |
if: env.TEST_RUN != 'true' && steps.is-full-release.outputs.is-full-release == 'true' | |
working-directory: ./dist | |
run: npm publish --tag latest --access public | |
- name: Release Candidate on NPM | |
if: env.TEST_RUN != 'true' && steps.is-full-release.outputs.is-full-release != 'true' | |
working-directory: ./dist | |
run: npm publish --access public |