Skip to content

Release trigger

Release trigger #6

name: Release trigger
on:
workflow_dispatch:
inputs:
version:
description: "Release version (X.Y.Z)"
required: true
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
release-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Set package version
run: npm version ${{ github.event.inputs.version }} --no-git-tag-version
# Replace "## [Unreleased]" with "## [X.Y.Z] - YYYY-MM-DD" in CHANGELOG.md
- name: Set changelog version
run: |
sed -i "s/## \[Unreleased\]/## \[${{ github.event.inputs.version }}\] - $(date +%Y-%m-%d)/" CHANGELOG.md
# Building for release should sync the version in multiple files, and then fail if there are any changes.
- name: Build for release
run: npm run build:release || exit 0
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Release v${{ github.event.inputs.version }}"
branch: release/${{ github.event.inputs.version }}
title: "Release v${{ github.event.inputs.version }}"
body: "Release ${{ github.event.inputs.version }}. See CHANGELOG.md and roadmap #6 for details."
token: ${{ secrets.GH_TOKEN }}