diff --git a/.github/workflows/mac-install-check.yml b/.github/workflows/mac-install-check.yml index 1d719f4..c1c2f5f 100644 --- a/.github/workflows/mac-install-check.yml +++ b/.github/workflows/mac-install-check.yml @@ -2,6 +2,7 @@ name: Mac one-line installer on: workflow_dispatch: push: + branches: [main] paths: - "docs/mac-install.sh" - ".github/workflows/mac-install-check.yml" @@ -10,7 +11,7 @@ jobs: install: strategy: matrix: - os: [macos-14, macos-15-intel] + os: [macos-15, macos-15-intel] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index c0a4eb6..85d82e9 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -165,4 +165,11 @@ jobs: GH_TOKEN: ${{ github.token }} run: | TAG=$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName --jq .tagName) + # The manifest gives the Mac entry the release's version; an app with another version would offer itself + # as an update forever. Refuse to upload unless the app inside the zip has the release's version. + APP_VERSION=$(unzip -p Buddy-mac.zip Buddy.app/Contents/Info.plist | python3 -c "import plistlib,sys; print(plistlib.load(sys.stdin.buffer)['CFBundleShortVersionString'])") + if [ "$APP_VERSION" != "${TAG#v}" ]; then + echo "::error::Buddy.app is $APP_VERSION but the latest release is $TAG; set VERSION in mac/buddy_mac/core.py to ${TAG#v}" + exit 1 + fi gh release upload "$TAG" Buddy-mac.zip --clobber --repo "$GITHUB_REPOSITORY" diff --git a/mac/buddy_mac/core.py b/mac/buddy_mac/core.py index afcddff..8a6abb4 100644 --- a/mac/buddy_mac/core.py +++ b/mac/buddy_mac/core.py @@ -21,7 +21,7 @@ from pathlib import Path APP_NAME = "Buddy" -VERSION = "1.2.0" +VERSION = "1.3.2" SUPPORT_DIR = Path.home() / "Library" / "Application Support" / APP_NAME SETTINGS_PATH = SUPPORT_DIR / "settings.json" diff --git a/mac/tests/test_core.py b/mac/tests/test_core.py index 19842e2..b841c12 100644 --- a/mac/tests/test_core.py +++ b/mac/tests/test_core.py @@ -311,7 +311,7 @@ def test_island_is_on_by_default(): assert core.DEFAULTS["island"] is True -# --------------------------------------------------------------------------- languages (1.2.0) +# --------------------------------------------------------------------------- languages (1.3.2) def test_prompt_answers_in_the_questions_language(): assert "Reply in the language of the question" in core.SYSTEM_PROMPT