Skip to content

Release

Release #6

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
dry_run:
description: Run release in "dry run" mode (does not publish)
default: false
type: boolean
permissions:
id-token: write # Required for npm Trusted Publishing (OIDC) + provenance
contents: write # Required to push the changelog/version commit + create the GH Release
issues: write # @semantic-release/github comments on / labels released issues
pull-requests: write # ...and on released pull requests
# Never cancel a release in flight: semantic-release pushes the tag and release
# commit before it publishes, so a cancelled run can leave the repo tagged with
# nothing on npm. Queue instead.
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
package_release:
name: Release from "${{ github.ref_name }}" branch
runs-on: ubuntu-latest
# GH does not allow limiting branches in workflow_dispatch settings, so guard here.
if: ${{ inputs.dry_run || github.ref_name == 'master' || github.ref_name == 'beta' || github.ref_name == 'alpha' || startsWith(github.ref_name, 'release') || endsWith(github.ref_name, '.x') }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # full history + tags required by semantic-release
- uses: ./.github/actions/setup-node
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
npx semantic-release
${{ inputs.dry_run && '--dry-run' || '' }}