Skip to content

fix: correct releases command #4

fix: correct releases command

fix: correct releases command #4

Workflow file for this run

name: release
on:
pull_request:
types: [closed]
push:
branches: [main]
workflow_dispatch:
inputs:
releaseType:
description: 'The release type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
debug:
if: github.event.pull_request.merged
runs-on: 'ubuntu-latest'
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: |
echo "$GITHUB_CONTEXT"
release-on-push:
if: github.event.pull_request.merged || inputs.releaseType != ''
runs-on: 'ubuntu-latest'
steps:
- name: Debug releaseType
if: inputs.releaseType != ''
run: |
echo "RELEASE TYPE: ${{ inputs.releaseType }}"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- name: Setup git user
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Install
run: npm install
- name: Prepare
run: npm run dev:prepare
- name: Major release
if: contains(github.event.pull_request.labels.*.name, 'release:major') || inputs.releaseType == 'major'
run: npm run release:major
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Minor release
if: contains(github.event.pull_request.labels.*.name, 'release:minor') || inputs.releaseType == 'minor'
run: npm run release:minor
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Patch release
if: contains(github.event.pull_request.labels.*.name, 'release:patch') || inputs.releaseType == 'patch'
run: npm run release:patch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}