From b4900989fa3b4fcac3d0db2719f41acb87cd2d0f Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Fri, 27 Sep 2024 08:27:13 +0200 Subject: [PATCH] Upload to emergetools --- ci_scripts/ci_post_xcodebuild.sh | 74 ++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 ci_scripts/ci_post_xcodebuild.sh diff --git a/ci_scripts/ci_post_xcodebuild.sh b/ci_scripts/ci_post_xcodebuild.sh new file mode 100644 index 00000000..bb4378f7 --- /dev/null +++ b/ci_scripts/ci_post_xcodebuild.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +set -e + +required_env_vars=( + "CI_ARCHIVE_PATH" + "CI_BRANCH" + "CI_COMMIT" + "EMERGE_API_KEY" +) + +for var in "${required_env_vars[@]}"; do + if [[ -z "${!var}" ]]; then + echo "Environment variable $var is not set" + exit 1 + fi +done + +brew install jq + +zip_path="$CI_ARCHIVE_PATH.zip" +pushd $(dirname $CI_ARCHIVE_PATH) +zip -r --symlinks "$(basename $zip_path)" "$(basename $CI_ARCHIVE_PATH)" +popd + +# Update this with your repo +repo_name='IceCubesApp' + +tag='release' +if [[ "$CI_XCODE_SCHEME" == "My Debug Archive Scheme" ]]; then + tag='debug' +fi + +json_fields=$(cat <