Skip to content

Commit b5dd509

Browse files
committed
ci: verify main, gate releases on version match, pin Sparkle, fix artifact names
- CI now runs on pushes to main (it was PR-only while commits land directly on main, so main was never build-verified) and runs the unit test suite alongside the build. - Releases gain a preflight that asserts the pushed tag matches project.yml's MARKETING_VERSION. Without it, tagging v2.6.0 with a stale project.yml shipped mismatched assets — and Sparkle still pushed them to every user, since CFBundleVersion (commit count) always grows. - workflow_dispatch removed from the release workflow: dispatched from a branch, github.ref_name is the branch name, which baked broken enclosure URLs into the appcast. A concurrency group serialises releases so concurrent tags can't race the gh-pages publish. - Sparkle is pinned to exactly 2.6.4 (matching the CLI tools CI pins). Package.resolved lives inside the gitignored, regenerated xcodeproj so it can't pin anything; the floating from:2.6.0 resolved a fresh latest 2.x each build — the stale-module failure while landing this commit confirmed local builds were already on a newer, unpinned Sparkle. - Release artifacts are named -universal instead of the runner's uname -m: the archive is universal (ARCHS_STANDARD, ONLY_ACTIVE_ARCH NO), and the old -arm64 suffix deterred the Intel users the README promises support for.
1 parent ff6f8a1 commit b5dd509

5 files changed

Lines changed: 45 additions & 8 deletions

File tree

.github/workflows/build-workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
sed -i '' 's/objectVersion = 77;/objectVersion = 70;/' CineScreen.xcodeproj/project.pbxproj
7171
grep -m1 "objectVersion" CineScreen.xcodeproj/project.pbxproj
7272
73-
- name: Build (Debug, no signing)
73+
- name: Build & test (Debug, no signing)
7474
if: '!inputs.release'
7575
run: |
7676
set -o pipefail
@@ -83,7 +83,7 @@ jobs:
8383
-destination 'platform=macOS' \
8484
CODE_SIGN_IDENTITY="-" \
8585
CODE_SIGNING_REQUIRED=NO \
86-
build | tee build/build.log
86+
build test | tee build/build.log
8787
8888
# ----- Code signing setup (release only) ------------------------------
8989
- name: Import signing certificate

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: CI
22

3+
# PRs and pushes to main both build + test. Commits land directly on main in
4+
# this repo, so a PR-only trigger left main permanently unverified.
35
on:
46
pull_request:
7+
push:
8+
branches: [main]
59

610
jobs:
711
build:

.github/workflows/release.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,41 @@
11
name: Release
22

3+
# Tag-push only. workflow_dispatch was removed deliberately: run from a
4+
# branch, github.ref_name is the branch name, which baked broken enclosure
5+
# URLs into the appcast and broke the release step's tag lookup.
36
on:
47
push:
58
tags:
69
- 'v*.*.*'
7-
workflow_dispatch:
810

911
permissions:
1012
contents: write
1113

14+
# One release at a time — concurrent tag pushes raced each other publishing
15+
# to gh-pages.
16+
concurrency:
17+
group: release
18+
cancel-in-progress: false
19+
1220
jobs:
21+
preflight:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Assert tag matches MARKETING_VERSION
26+
run: |
27+
TAG="${GITHUB_REF_NAME#v}"
28+
VERSION="$(grep -E '^\s*MARKETING_VERSION:' project.yml | head -1 | sed 's/.*"\(.*\)".*/\1/')"
29+
if [ "$TAG" != "$VERSION" ]; then
30+
echo "Tag v$TAG does not match project.yml MARKETING_VERSION=$VERSION." >&2
31+
echo "Bump MARKETING_VERSION and commit before tagging — Sparkle's" >&2
32+
echo "CFBundleVersion is the commit count, so a mismatched tag would" >&2
33+
echo "still auto-update every user to wrongly-versioned assets." >&2
34+
exit 1
35+
fi
36+
1337
build:
38+
needs: preflight
1439
uses: ./.github/workflows/build-workflow.yml
1540
with:
1641
upload-artifacts: true

project.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ packages:
3535
# Sparkle powers in-place auto-updates. Updating the app at its existing
3636
# path preserves its code-signing identity, so TCC keeps the user's granted
3737
# Accessibility / Screen Recording permissions — no re-granting after updates.
38+
#
39+
# Pinned exactly (Package.resolved lives inside the gitignored, regenerated
40+
# xcodeproj, so it can't pin anything): a floating `from:` resolved a fresh
41+
# latest-2.x on every release build — non-reproducible builds and silent
42+
# framework/CLI skew against the 2.6.4 appcast tools pinned in CI.
3843
Sparkle:
3944
url: https://github.com/sparkle-project/Sparkle
40-
from: "2.6.0"
45+
exactVersion: "2.6.4"
4146

4247
targets:
4348
CineScreen:

scripts/make_release.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,20 @@ VERSION="$(grep -E '^\s*MARKETING_VERSION:' project.yml | head -1 | sed 's/.*"\(
5555
# monotonic build number from the commit count. (Requires a full clone — CI
5656
# checks out with fetch-depth: 0.)
5757
BUILD_NUMBER="$(git rev-list --count HEAD 2>/dev/null || echo 1)"
58-
ARCH="$(uname -m)"
59-
DMG_PATH="$RELEASE_DIR/CineScreen-${VERSION}-${ARCH}.dmg"
60-
ZIP_PATH="$RELEASE_DIR/CineScreen-${VERSION}-${ARCH}.zip"
58+
# The archive is universal (ARCHS_STANDARD + ONLY_ACTIVE_ARCH=NO) — naming
59+
# artifacts after the build runner's `uname -m` mislabelled them "-arm64",
60+
# contradicting the README's Intel support and deterring Intel users.
61+
ARTIFACT_SUFFIX="universal"
62+
DMG_PATH="$RELEASE_DIR/CineScreen-${VERSION}-${ARTIFACT_SUFFIX}.dmg"
63+
ZIP_PATH="$RELEASE_DIR/CineScreen-${VERSION}-${ARTIFACT_SUFFIX}.zip"
6164

6265
rm -rf "$RELEASE_DIR/build" "$EXPORT_PATH"
6366
mkdir -p "$BUILD_DIR" "$RELEASE_DIR"
6467

6568
# ---------------------------------------------------------------------------
6669
# Archive
6770
# ---------------------------------------------------------------------------
68-
echo "==> xcodebuild archive (Release, $ARCH)"
71+
echo "==> xcodebuild archive (Release, universal)"
6972

7073
XCODEBUILD_ARGS=(
7174
-project "$PROJECT"

0 commit comments

Comments
 (0)