* Add `make ideploy` command for publishing iOS releases. * Get release version from latest ios git tag. * Use caffeinate to prevent the system from sleeping during the deploy process. * Checkout tag to ensure correct commit is used * Fail if release has already been published (not a draft) on GitHub * Add publish step logging and colorize it. * Allow s3 upload to show progress. * Use build/ios/deploy directory for downloaded release zips; always overwrite via -O flag. * Add zip filename to s3 step. * Auto-install github-release command
39 lines
784 B
Bash
Executable File
39 lines
784 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
set -o pipefail
|
|
set -u
|
|
|
|
function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
|
|
function finish { >&2 echo -en "\033[0m"; }
|
|
trap finish EXIT
|
|
|
|
#
|
|
# iOS release tag format is `vX.Y.Z`; `X.Y.Z` gets passed in
|
|
# In the case of symbolicated builds, we also append the `-symbols`.
|
|
#
|
|
PUBLISH_VERSION="$1"
|
|
|
|
if [[ ${#} -eq 2 ]]; then
|
|
PUBLISH_STYLE="-$2"
|
|
else
|
|
PUBLISH_STYLE=""
|
|
fi
|
|
|
|
#
|
|
# zip
|
|
#
|
|
cd build/ios/pkg
|
|
ZIP=mapbox-ios-sdk-${PUBLISH_VERSION}${PUBLISH_STYLE}.zip
|
|
step "Compressing ${ZIP}…"
|
|
rm -f ../${ZIP}
|
|
zip -r ../${ZIP} *
|
|
|
|
#
|
|
# upload
|
|
#
|
|
step "Uploading ${ZIP} to s3…"
|
|
REPO_NAME=$(basename $TRAVIS_REPO_SLUG)
|
|
aws s3 cp ../${ZIP} s3://mapbox/$REPO_NAME/ios/builds/ --acl public-read
|
|
echo http://mapbox.s3.amazonaws.com/$REPO_NAME/ios/builds/${ZIP}
|