Scripts/release-ios.sh

41 lines · 1743 bytes · executable

1 symbol in this file
 1#!/bin/sh
 2#
 3# Archive the app, its widget and its share extension, and upload the result to
 4# App Store Connect. The work is done by appstore-kit, checked out beside this
 5# repository or at $APPSTORE_KIT.
 6#
 7#   ./Scripts/release-ios.sh            # archive, export and upload
 8#   DOMAIN_DIG_PUBLISH=0 ./Scripts/release-ios.sh
 9#                                       # archive and export the .ipa only
10#
11# The build number is CURRENT_PROJECT_VERSION as committed, not the commit
12# count. This project sets it by hand at each cut, states it in the cut's
13# commit message, and verifies it against the built product; deriving it
14# instead would make the committed value a lie.
15#
16# A publish requires HEAD to be the commit that v<version> points at, so an
17# upload cannot carry code the tag does not. The bundled release notes are
18# checked against the marketing version, which nothing else does — the unit
19# suite asserts the notes parse, not that they describe this build.
20
21PUBLISH="${DOMAIN_DIG_PUBLISH:-1}"
22name=DomainDig
23project=DomainDig.xcodeproj
24scheme=DomainDig
25build_number=committed
26allow_untracked=1
27
28preflight() {
29    notes_version="$(
30        python3 -c 'import json; print(json.load(open("DomainDig/ReleaseNotes.json"))["version"])'
31    )"
32    [ "$notes_version" = "$version" ] \
33        || fail "ReleaseNotes.json is $notes_version but MARKETING_VERSION is $version"
34    [ "$publish" != 0 ] || return 0
35    git rev-parse -q --verify "refs/tags/v$version" >/dev/null \
36        || fail "no tag v$version — cut the release first"
37    [ "$(git rev-parse "v$version^{commit}")" = "$(git rev-parse HEAD)" ] \
38        || fail "v$version does not point at HEAD"
39}
40
41. "${APPSTORE_KIT:-$(dirname "$0")/../../appstore-kit}/release-ios.sh"