Skip to content

Create New Version

Create New Version #11

Workflow file for this run

name: Create New Version
on:
workflow_dispatch:
inputs:
release-type:
type: choice
description: 'Release type (one of): patch, minor, major,prepatch, preminor, premajor'
required: true
default: 'patch'
options:
- patch
- minor
- major
- prepatch
- preminor
- premajor
jobs:
release:
name: Create New Version
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 🔍 GH_TOKEN
if: env.GH_TOKEN == ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
- name: 📦 Checkout project repo
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master
token: ${{ secrets.GH_TOKEN }}
- name: 📝 Git User Setup
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: 📦 Install Project Dependencies
run: pnpm install --frozen-lockfile
- name: 🏃‍♂️ Create tag
run: |
pnpm run np ${{ github.event.inputs.release-type }} --no-publish
- name: 📦 Publish to npm
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPMJS_ACCESS_TOKEN }}