Files
Conal Mullan b86feda618 CI: bump GitHub Actions to Node 24-compatible versions
Node.js 20 is being forced to Node 24 on GHA runners starting June 2nd,
2026, then removed Sep 16th, 2026. Each major bump below was the action's
explicit Node 24 transition release; none touch inputs we use.

- actions/checkout@v4 → @v6 (Node 24 since v5)
- docker/setup-buildx-action@v3 → @v4
- docker/login-action@v3 → @v4
- docker/metadata-action@v5 → @v6
- docker/build-push-action@v5 → @v7
- softprops/action-gh-release@v2 → @v3
- peter-evans/create-pull-request@v6 → @v8
2026-05-10 00:59:52 +01:00

95 lines
3.0 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 0.4.0). Leave empty to read from toolkit-registry.json'
required: false
type: string
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history for changelog generation
- name: Get version
id: version
run: |
if [ -n "${{ github.event.inputs.version }}" ]; then
VERSION="${{ github.event.inputs.version }}"
elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
else
VERSION=$(jq -r '.version' _internal/toolkit-registry.json)
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
echo "Releasing version: $VERSION"
- name: Check tag exists (for manual dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
TAG="v${{ steps.version.outputs.version }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists"
else
echo "Creating tag $TAG"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "$TAG"
git push origin "$TAG"
fi
- name: Get previous tag
id: prev_tag
run: |
CURRENT_TAG="v${{ steps.version.outputs.version }}"
PREV_TAG=$(git tag --sort=-version:refname | grep -v "$CURRENT_TAG" | head -n 1)
if [ -z "$PREV_TAG" ]; then
# No previous tag, use first commit
PREV_TAG=$(git rev-list --max-parents=0 HEAD)
fi
echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT
echo "Previous tag: $PREV_TAG"
- name: Generate changelog
id: changelog
run: |
CURRENT_TAG="v${{ steps.version.outputs.version }}"
PREV_TAG="${{ steps.prev_tag.outputs.prev_tag }}"
echo "## What's Changed" > changelog.md
echo "" >> changelog.md
# Get commits since previous tag
git log --pretty=format:"* %s (%h)" "$PREV_TAG".."$CURRENT_TAG" 2>/dev/null >> changelog.md || \
git log --pretty=format:"* %s (%h)" "$PREV_TAG"..HEAD >> changelog.md
echo "" >> changelog.md
echo "" >> changelog.md
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${CURRENT_TAG}" >> changelog.md
cat changelog.md
- name: Create Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
body_path: changelog.md
draft: false
prerelease: false
generate_release_notes: false