mirror of
https://github.com/github/spec-kit.git
synced 2026-03-17 10:53:08 +00:00
* fix: split release process to sync pyproject.toml version with git tags (#1721) - Split release workflow into two: release-trigger.yml and release.yml - release-trigger.yml: Updates pyproject.toml, generates changelog from commits, creates tag - release.yml: Triggered by tag push, builds artifacts, creates GitHub release - Ensures git tags point to commits with correct version in pyproject.toml - Auto-generates changelog from commit messages since last tag - Supports manual version input or auto-increment patch version - Added simulate-release.sh for local testing without pushing - Added comprehensive RELEASE-PROCESS.md documentation - Updated pyproject.toml to v0.1.10 to sync with latest release This fixes the version mismatch issue where tags pointed to commits with outdated pyproject.toml versions, preventing confusion when installing from source. * Update .github/workflows/RELEASE-PROCESS.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/scripts/simulate-release.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/release.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/release-trigger.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: harden release-trigger against shell injection and fix stale docs - Pass workflow_dispatch version input via env: instead of direct interpolation into shell script, preventing potential injection attacks - Validate version input against strict semver regex before use - Fix RELEASE-PROCESS.md Option 2 still referencing [Unreleased] section handling that no longer exists in the workflow --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
echo "tag=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "Building release for $VERSION"
|
|
|
|
- name: Check if release already exists
|
|
id: check_release
|
|
run: |
|
|
chmod +x .github/workflows/scripts/check-release-exists.sh
|
|
.github/workflows/scripts/check-release-exists.sh ${{ steps.version.outputs.tag }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create release package variants
|
|
if: steps.check_release.outputs.exists == 'false'
|
|
run: |
|
|
chmod +x .github/workflows/scripts/create-release-packages.sh
|
|
.github/workflows/scripts/create-release-packages.sh ${{ steps.version.outputs.tag }}
|
|
|
|
- name: Generate release notes
|
|
if: steps.check_release.outputs.exists == 'false'
|
|
id: release_notes
|
|
run: |
|
|
chmod +x .github/workflows/scripts/generate-release-notes.sh
|
|
# Get the previous tag for changelog generation
|
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 ${{ steps.version.outputs.tag }}^ 2>/dev/null || echo "")
|
|
# Default to v0.0.0 if no previous tag is found (e.g., first release)
|
|
if [ -z "$PREVIOUS_TAG" ]; then
|
|
PREVIOUS_TAG="v0.0.0"
|
|
fi
|
|
.github/workflows/scripts/generate-release-notes.sh ${{ steps.version.outputs.tag }} "$PREVIOUS_TAG"
|
|
|
|
- name: Create GitHub Release
|
|
if: steps.check_release.outputs.exists == 'false'
|
|
run: |
|
|
chmod +x .github/workflows/scripts/create-github-release.sh
|
|
.github/workflows/scripts/create-github-release.sh ${{ steps.version.outputs.tag }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|