Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Release a new version #4

Release a new version

Release a new version #4

Workflow file for this run

name: Release a new version
on:
workflow_dispatch:
inputs:
version:
type: choice
description: 'Define release mode'
required: true
default: 'patch'
options:
- 'minor'
- 'major'
- 'patch'
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: npm install
- name: Set git credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Bump version and tag
run: |
# Depending on how you want to bump, you may use
# 'minor', 'major', 'patch', etc instead of 'minor'
# npm version minor -m "Bump to %s"
npm version ${{ github.event.inputs.version }} -m "Bump to %s"
git push --follow-tags
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}