diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b1b585c4b..f30ffaded 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -52,7 +52,7 @@ jobs: MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }} MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }} MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }} - run: make release-launcher-darwin + run: make release-launcher-darwin LAUNCHER_APP_VERSION="${GITHUB_REF_NAME#v}" - name: Upload DMG to Release uses: softprops/action-gh-release@v3 with: diff --git a/Makefile b/Makefile index 1f25e246c..cd8456c76 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ GOTEST=$(GOCMD) test GOVET=$(GOCMD) vet BINARY_NAME=local-ai LAUNCHER_BINARY_NAME=local-ai-launcher +LAUNCHER_APP_VERSION?=0.0.0 UBUNTU_VERSION?=2404 UBUNTU_CODENAME?=noble @@ -1603,7 +1604,7 @@ site-serve: site build-launcher-darwin: rm -rf dist/LocalAI.app cmd/launcher/LocalAI.app mkdir -p dist - cd cmd/launcher && go run fyne.io/tools/cmd/fyne@latest package -os darwin -icon ../../core/http/static/logo.png --executable $(LAUNCHER_BINARY_NAME) + cd cmd/launcher && go run fyne.io/tools/cmd/fyne@latest package -os darwin -icon ../../core/http/static/logo.png --app-version $(LAUNCHER_APP_VERSION) --executable $(LAUNCHER_BINARY_NAME) mv cmd/launcher/LocalAI.app dist/LocalAI.app bash contrib/macos/sign-and-notarize.sh sign dist/LocalAI.app diff --git a/scripts/build/launcher-release-version_test.sh b/scripts/build/launcher-release-version_test.sh new file mode 100644 index 000000000..09be054ff --- /dev/null +++ b/scripts/build/launcher-release-version_test.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT=$(dirname "$(dirname "$(dirname "$(realpath "$0")")")") +MAKEFILE="$ROOT/Makefile" +WORKFLOW="$ROOT/.github/workflows/release.yaml" + +dry_run=$(make -n -f "$MAKEFILE" build-launcher-darwin LAUNCHER_APP_VERSION=9.8.7) +if ! grep -Fq -- '--app-version 9.8.7' <<<"$dry_run"; then + echo "FAIL: macOS launcher packaging does not pass LAUNCHER_APP_VERSION to Fyne" + exit 1 +fi + +if ! grep -Fq -- 'LAUNCHER_APP_VERSION="${GITHUB_REF_NAME#v}"' "$WORKFLOW"; then + echo "FAIL: release workflow does not derive the launcher app version from the tag" + exit 1 +fi + +echo "PASS: macOS launcher releases stamp the tag-derived app version"