|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +set -xe |
| 4 | + |
| 5 | +env | sort |
| 6 | + |
| 7 | +echo "***** Start: Building Activitysim installer *****" |
| 8 | +CONSTRUCT_ROOT="${CONSTRUCT_ROOT:-${PWD}}" |
| 9 | + |
| 10 | +cd "${CONSTRUCT_ROOT}" |
| 11 | + |
| 12 | +# Constructor should be latest for non-native building |
| 13 | +# See https://github.com/conda/constructor |
| 14 | +echo "***** Install constructor *****" |
| 15 | +conda install -y "constructor>=3.3.1" jinja2 curl libarchive -c conda-forge --override-channels |
| 16 | + |
| 17 | +if [[ "$(uname)" == "Darwin" ]]; then |
| 18 | + conda install -y coreutils -c conda-forge --override-channels |
| 19 | +fi |
| 20 | +# shellcheck disable=SC2154 |
| 21 | +if [[ "${TARGET_PLATFORM}" == win-* ]]; then |
| 22 | + conda install -y "nsis=3.01" -c conda-forge --override-channels |
| 23 | +fi |
| 24 | +# pip install git+git://github.com/conda/constructor@3.3.1#egg=constructor --force --no-deps |
| 25 | +conda list |
| 26 | + |
| 27 | +echo "***** Make temp directory *****" |
| 28 | +TEMP_DIR=$(mktemp -d --tmpdir=C:/Users/RUNNER~1/AppData/Local/Temp/); |
| 29 | + |
| 30 | +echo "***** Copy file for installer construction *****" |
| 31 | +cp -R other_resources/installer "${TEMP_DIR}/" |
| 32 | +cp LICENSE.txt "${TEMP_DIR}/installer/" |
| 33 | + |
| 34 | +ls -al "${TEMP_DIR}" |
| 35 | + |
| 36 | +echo "***** Construct the installer *****" |
| 37 | +# Transmutation requires the current directory is writable |
| 38 | +cd "${TEMP_DIR}" |
| 39 | +# shellcheck disable=SC2086 |
| 40 | +constructor "${TEMP_DIR}/installer/" --output-dir "${TEMP_DIR}" |
| 41 | +cd - |
| 42 | + |
| 43 | +cd "${TEMP_DIR}" |
| 44 | + |
| 45 | +# This line will break if there is more than one installer in the folder. |
| 46 | +INSTALLER_PATH=$(find . -name "Activitysim*.${EXT}" | head -n 1) |
| 47 | + |
| 48 | +echo "***** Move installer to build folder *****" |
| 49 | +mkdir -p "${CONSTRUCT_ROOT}/build" |
| 50 | +mv "${INSTALLER_PATH}" "${CONSTRUCT_ROOT}/build/" |
| 51 | + |
| 52 | +echo "***** Done: Building ActivitySim installer *****" |
| 53 | +cd "${CONSTRUCT_ROOT}" |
0 commit comments