[Release] NPM publish 0.52.5 #167
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: '[Release] NPM publish' | |
run-name: '[Release] NPM publish ${{ inputs.version }}' | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
description: 'Version to publish' | |
required: true | |
default: '0.0.0' | |
jobs: | |
npm-publish: | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_PAT }} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: 'npm' | |
node-version-file: '.nvmrc' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install dependencies | |
run: npm ci | |
- name: Publish npm packages | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
shell: bash | |
run: | | |
npx zx ./scripts/publish.mjs --version="${{ inputs.version }}" | |
- name: Publish release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npx zx ./scripts/gitrelease.mjs "${{ inputs.version }}" "${{ github.head_ref || github.ref_name }}" |