1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 09:00:07 +02:00
audacity/scripts/ci/environment.sh
Peter Jonas 4b5c95d7fe Move GitHub Actions CI scripts into separate files
Break the workflow into smaller stages (Configure, Build, Install,
Package, etc.) so that you can see exactly which stage failed in the
GitHub Actions run log.

Create a separate Bash CI script for each job stage (configure.sh,
build.sh, install.sh, package.sh, etc.) to reduce the size of the main
YAML workflow file and enable Bash syntax highlighting.

Close #917
2021-06-10 10:09:49 -07:00

26 lines
817 B
Bash

#!/usr/bin/env bash
if [[ "$0" == "${BASH_SOURCE}" ]]; then
echo >&2 "$0: Please source this script instead of running it."
exit 1
fi
((${BASH_VERSION%%.*} >= 4)) || { echo >&2 "${BASH_SOURCE}: Error: Please upgrade Bash."; return 1; }
function gh_export()
{
[[ "${GITHUB_ENV-}" ]] || local -r GITHUB_ENV="/dev/null"
export -- "$@" && printf "%s\n" "$@" >> "${GITHUB_ENV}"
}
repository_root="$(cd "$(dirname "${BASH_SOURCE}")/../.."; echo "${PWD}")"
gh_export CONAN_USER_HOME="${repository_root}/conan-home/"
gh_export CONAN_USER_HOME_SHORT="${repository_root}/conan-home/short"
gh_export GIT_HASH="$(git show -s --format='%H')"
gh_export GIT_HASH_SHORT="$(git show -s --format='%h')"
gh_export AUDACITY_BUILD_TYPE="Release"
gh_export AUDACITY_INSTALL_PREFIX="${repository_root}/build/install"