Skip to content

Release v2.0.0-beta.17 #186

Release v2.0.0-beta.17

Release v2.0.0-beta.17 #186

Workflow file for this run

name: Release
run-name: ${{ github.workflow }} v${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: 'Bump version (e.g., 4.0.0, 4.1.0-alpha.1, 5.0.0-beta.2)'
required: true
type: string
tag:
description: 'npm dist-tag to publish under (leave empty to fallback to preid, or "latest" for stable)'
required: false
type: string
skip_git_check:
description: Skip git checks when publishing (--no-git-checks)
required: false
type: boolean
default: false
skip_bump:
description: Skip version bump (bumpp) step
required: false
type: boolean
default: false
skip_changelog:
description: Skip changelog generation (changelogithub) step
required: false
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- id: version
run: |
VERSION="${{ github.event.inputs.version }}"
if [[ $VERSION =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-([a-z]+)\.([1-9][0-9]*))?$ ]]; then
if [[ "${BASH_REMATCH[5]}" == "latest" ]]; then
echo "INVALID VERSION FORMAT ('latest' is not allowed): $VERSION" >&2
exit 1
fi
echo "major=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
echo "minor=${BASH_REMATCH[2]}" >> $GITHUB_OUTPUT
echo "patch=${BASH_REMATCH[3]}" >> $GITHUB_OUTPUT
echo "preid=${BASH_REMATCH[5]}" >> $GITHUB_OUTPUT
echo "number=${BASH_REMATCH[6]}" >> $GITHUB_OUTPUT
else
echo "INVALID VERSION FORMAT: $VERSION" >&2
exit 1
fi
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: pnpm/action-setup@v6
- run: pnpm i
- run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- run: pnpm exec bumpp -r ${{ github.event.inputs.version }} --yes
if: ${{ github.event.inputs.skip_bump != 'true' }}
- run: pnpm exec changelogithub --draft
if: ${{ github.event.inputs.skip_changelog != 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: pnpm --filter='./packages/*' run -r build
- run: pnpm --filter='./packages/*' publish -r --provenance --access=public --tag=${{ github.event.inputs.tag || steps.version.outputs.preid || 'latest' }} ${{ github.event.inputs.skip_git_check == 'true' && '--no-git-checks' || '' }}