From 0765fc7bcbfd16c57a28fd7efac274f23c63b975 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sun, 27 Sep 2026 14:52:26 +0200 Subject: [PATCH] ci: derive the build number from the release version agvtool next-version bumped the committed build number on every run without committing it back, so every release shipped as build 3. The App Store needs build numbers that increase across uploads, so set CURRENT_PROJECT_VERSION to major*1000000 + minor*1000 + patch (2.26.0 -> 2026000), which always grows with the version and maps back to its tag. --- .github/workflows/release.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ddb04b2..1a18311 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,12 +91,15 @@ jobs: persist-credentials: false - name: Update version + env: + VERSION: ${{ needs.version.outputs.new-release-version }} run: | - echo "The version is ${{ needs.version.outputs.new-release-version }}" + IFS=. read -r MAJOR MINOR PATCH <<< "$VERSION" + BUILD=$((MAJOR * 1000000 + MINOR * 1000 + PATCH)) PROJECT_FILE="Magic Switch.xcodeproj/project.pbxproj" - sed -i '' "s/MARKETING_VERSION = .*;/MARKETING_VERSION = ${{ needs.version.outputs.new-release-version }};/g" "$PROJECT_FILE" - echo "Updated Marketing version to ${{ needs.version.outputs.new-release-version }}" - agvtool next-version -all + sed -i '' "s/MARKETING_VERSION = .*;/MARKETING_VERSION = $VERSION;/g" "$PROJECT_FILE" + sed -i '' "s/CURRENT_PROJECT_VERSION = .*;/CURRENT_PROJECT_VERSION = $BUILD;/g" "$PROJECT_FILE" + echo "Version $VERSION, build $BUILD" - name: Set up Xcode uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1