p2p-swift / scripts / release-check.sh
150 words
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# scripts/release-check.sh — everything that must be green before tagging a
# release: the manifest parses, the package builds and the offline test suite
# passes on macOS, and the working tree is clean. RELEASE=1 additionally
# requires HEAD to carry a version tag; IOS=1 also builds for the iOS Simulator.
set -euo pipefail
cd "$(dirname "$0")/.."

echo "== manifest"
swift package dump-package > /dev/null

echo "== build (macOS)"
swift build

echo "== tests (offline)"
swift test

if [ "${IOS:-0}" = "1" ]; then
  echo "== build (iOS Simulator)"
  xcodebuild -scheme ird-p2p-swift -destination 'generic/platform=iOS Simulator' -derivedDataPath .build/DerivedData build | grep -E "BUILD|error:" || true
fi

echo "== working tree"
if [ -n "$(git status --porcelain)" ]; then
  echo "ABORT: uncommitted changes" >&2
  git status --short >&2
  exit 1
fi

if [ "${RELEASE:-0}" = "1" ]; then
  echo "== tag"
  git describe --exact-match --tags HEAD
fi

echo "release-check: OK"

static mirror of HEAD · about · clone: git clone https://ird.cod-sursa.ro/p2p-swift.git