Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
runs-on: macos-26
steps:
- uses: actions/checkout@v7
with:
# scripts/version.sh counts every commit for the build number.
fetch-depth: 0

- name: Show toolchain
run: swift --version
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
RELEASING: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v7
with:
# scripts/version.sh counts every commit for the build number.
fetch-depth: 0

- name: Derive the version from the tag
if: env.RELEASING == 'true'
Expand Down
3 changes: 2 additions & 1 deletion docs/specs/app-store/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ are tabletop-kit's `scripts/package-appstore.sh` (its `appstore-build` spec).
## R1 The build
- R1.1 `CHANNEL=appstore scripts/build-app.sh` (or `make appstore`) builds the package `build/appstore/Mapsmith.pkg`
from the same sources as the disk image; Mapsmith has no updater or payment link to leave out.
- R1.2 The build number (`BUILD_NUMBER`) is apart from the version and increases with every upload.
- R1.2 The build number (`BUILD_NUMBER`) is apart from the version: it is the number of commits on main
(scripts/version.sh), so it increases with every merge and every upload.
- R1.3 The bundle declares `ITSAppUsesNonExemptEncryption` as false, a copyright line and the real version.

## R2 Privacy
Expand Down
11 changes: 6 additions & 5 deletions scripts/build-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
#
# Usage: scripts/build-app.sh [--install] (--install moves it to /Applications)
#
# VERSION version written to the bundle (default 0.0.0)
# VERSION version written to the bundle (default: scripts/version.sh marketing)
# UNIVERSAL set to 1 to build for both Apple silicon and Intel
# TEAM_ID the team that owns the App Group (default: read from the Developer ID certificate)
# SIGNING_IDENTITY passed to scripts/sign-app.sh; "-" signs ad hoc, without the App Group
# BUILD_NUMBER CFBundleVersion, which must increase with every App Store upload (default: VERSION)
# BUILD_NUMBER CFBundleVersion, which must increase with every App Store upload (default: scripts/version.sh build)
# CHANNEL "appstore" also builds the Mac App Store package, build/appstore/Mapsmith.pkg, with tabletop-kit's
# scripts/package-appstore.sh (PACKAGER names another copy); needs TEAM_ID and that script's variables,
# and TRIAL=1 checks it without them. Mapsmith has no updater or payment link, so the sources are the same.
set -euo pipefail

cd "$(dirname "$0")/.."
VERSION="${VERSION:-0.0.0}"
VERSION="${VERSION:-$(scripts/version.sh marketing)}"
BUILD_NUMBER="${BUILD_NUMBER:-$(scripts/version.sh build)}"
APP="build/Mapsmith.app"
EXECUTABLE="Mapsmith"

Expand All @@ -36,7 +37,7 @@ cp Resources/AppIcon.icns "$APP/Contents/Resources/AppIcon.icns"
cp Resources/container-migration.plist "$APP/Contents/Resources/container-migration.plist"
cp ios/App/PrivacyInfo.xcprivacy "$APP/Contents/Resources/PrivacyInfo.xcprivacy"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $VERSION" \
-c "Set :CFBundleVersion ${BUILD_NUMBER:-$VERSION}" "$APP/Contents/Info.plist"
-c "Set :CFBundleVersion $BUILD_NUMBER" "$APP/Contents/Info.plist"
# The entitlements turn on the App Sandbox. A build signed with the team's Developer ID also joins the Tableside
# Toolkit's App Group, where Scrollkeeper shares its library: the team's ID takes the place of TEAM_ID. The team ID
# is read from the signing certificate, or from TEAM_ID in the environment. An ad hoc
Expand All @@ -53,7 +54,7 @@ else
/usr/libexec/PlistBuddy -c "Delete :com.apple.security.application-groups" "$ENTITLEMENTS"
fi
scripts/sign-app.sh "$APP" "$ENTITLEMENTS"
echo "Built $APP ($VERSION)"
echo "Built $APP ($VERSION, build $BUILD_NUMBER)"

if [[ "${CHANNEL:-}" == "appstore" ]]; then
# Found beside the package after "swift package resolve", so the script follows the dependency pin.
Expand Down
Loading