Skip to content

feat: add one click npm release workflow #2

feat: add one click npm release workflow

feat: add one click npm release workflow #2

Workflow file for this run

name: One-Click NPM Release
on:
workflow_dispatch:
inputs:
release_type:
description: 'Release type (patch/minor/major)'
required: true
default: 'patch'
# Remove before merge
pull_request:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Configure Git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Run release-it
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn release ${{ github.event.inputs.release_type }} \
--ci \
--github.release \
--npm.publish \
--no-git.requireCleanWorkingDir \
--dry-run \
--verbose