Skip to content

Increase the version to v0.1.0-alpha.5 (#5) #10

Increase the version to v0.1.0-alpha.5 (#5)

Increase the version to v0.1.0-alpha.5 (#5) #10

Workflow file for this run

name: Publish to npm
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
dry_run:
description: "Run npm publish in dry-run mode"
required: false
default: "false"
type: choice
options:
- "false"
- "true"
permissions:
contents: read
jobs:
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
cache: "npm"
- name: Show Node and npm Versions
run: |
node -v
npm -v
- name: Install dependencies
run: npm install --legacy-peer-deps
- name: Run Tests
run: npm test
- name: Build Package
run: npm run build
- name: Verify Package Content
run: npm pack --dry-run
- name: Publish to `npm`
if: >-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
- name: Dry-run Publish
if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true'
run: npm publish --access public --dry-run