From 39240c3d4f2f600c8692167eaf513f708c000174 Mon Sep 17 00:00:00 2001 From: Andy <119136210+AndyMik90@users.noreply.github.com> Date: Mon, 12 Jan 2026 15:44:24 +0100 Subject: [PATCH] fix(ci): fix semver comparison for release workflow (#954) - Use npx semver instead of sort -V for proper semantic version comparison (sort -V incorrectly ranked 2.7.3-beta.1 > 2.7.3, blocking the release) - Add workflow_dispatch trigger with force option for manual releases - Fix CHANGELOG.md formatting (remove # that caused header rendering) Co-authored-by: Claude Opus 4.5 --- .github/workflows/prepare-release.yml | 19 +++++++++++++++---- CHANGELOG.md | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index ac108378..2289bad1 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -12,6 +12,13 @@ on: paths: - 'apps/frontend/package.json' - 'package.json' + workflow_dispatch: + inputs: + force: + description: 'Force release even if version check fails (use with caution)' + required: false + default: false + type: boolean jobs: check-and-tag: @@ -54,16 +61,20 @@ jobs: run: | PACKAGE_VERSION="${{ steps.package.outputs.version }}" LATEST_VERSION="${{ steps.latest_tag.outputs.version }}" + FORCE="${{ github.event.inputs.force }}" echo "Comparing: package=$PACKAGE_VERSION vs latest_tag=$LATEST_VERSION" - # Use sort -V for version comparison - HIGHER=$(printf '%s\n%s' "$PACKAGE_VERSION" "$LATEST_VERSION" | sort -V | tail -n1) - - if [ "$HIGHER" = "$PACKAGE_VERSION" ] && [ "$PACKAGE_VERSION" != "$LATEST_VERSION" ]; then + # Use npx semver for proper semantic version comparison + # This correctly handles pre-release versions (2.7.3 > 2.7.3-beta.1) + if npx -y semver "$PACKAGE_VERSION" -r ">$LATEST_VERSION" > /dev/null 2>&1; then echo "should_release=true" >> $GITHUB_OUTPUT echo "new_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT echo "✅ New release needed: v$PACKAGE_VERSION" + elif [ "$FORCE" = "true" ]; then + echo "should_release=true" >> $GITHUB_OUTPUT + echo "new_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT + echo "⚠️ Force release enabled: v$PACKAGE_VERSION" else echo "should_release=false" >> $GITHUB_OUTPUT echo "⏭️ No release needed (package version not newer than latest tag)" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b9aa5b9..26892a83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -442,7 +442,7 @@ - fix: Solve ladybug problem on running npm install all on windows (#576) by @Alex in effaa681 - fix(merge): handle Windows CRLF line endings in regex fallback by @AndyMik90 in 04de8c78 - ci(release): add CHANGELOG.md validation and fix release workflow by @AndyMik90 in 6d4231ed -- # 🔥 hotfix(electron): restore app functionality on Windows broken by GPU cache errors (#569) by @sniggl in dedd0757 +- 🔥 hotfix(electron): restore app functionality on Windows broken by GPU cache errors (#569) by @sniggl in dedd0757 - fix(ci): cache pip wheels to speed up Intel Mac builds by @AndyMik90 in 90dddc28 - feat(terminal): respect preferred terminal setting for Windows PTY shell by @AndyMik90 in 90a20320 - fix(ci): add Python setup to beta-release and fix PR status gate checks (#565) by @Andy in c2148bb9