Skip to content

Commit

Permalink
make interaction with some GITHUB_* vars conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Mar 31, 2024
1 parent a898703 commit 31d7d29
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ while getopts 'tc:k:d:l:pa:x:n:' flag; do
l) PUB_CACHE_KEY="$OPTARG" ;;
p) PRINT_ONLY=true ;;
t) TEST_MODE=true ;;
t) TEST_MODE=true ;; # Uses RELEASE_MANIFEST from test/ directory, instead of fetching it from Google
a) ARCH="$(echo "$OPTARG" | awk '{print tolower($0)}')" ;;
x) PRECACHE="$OPTARG" ;;
n) VERSION="$OPTARG" ;;
Expand Down Expand Up @@ -177,15 +178,17 @@ if [[ "$PRINT_ONLY" == true ]]; then
exit 0
fi

{
echo "CHANNEL=$info_channel"
echo "VERSION=$info_version"
echo "ARCHITECTURE=$info_architecture"
echo "CACHE-KEY=$CACHE_KEY"
echo "CACHE-PATH=$CACHE_PATH"
echo "PUB-CACHE-KEY=$PUB_CACHE_KEY"
echo "PUB-CACHE-PATH=$PUB_CACHE"
} >>"$GITHUB_OUTPUT"
if [[ -n "${GITHUB_OUTPUT:-}" ]]; then
{
echo "CHANNEL=$info_channel"
echo "VERSION=$info_version"
echo "ARCHITECTURE=$info_architecture"
echo "CACHE-KEY=$CACHE_KEY"
echo "CACHE-PATH=$CACHE_PATH"
echo "PUB-CACHE-KEY=$PUB_CACHE_KEY"
echo "PUB-CACHE-PATH=$PUB_CACHE"
} >>"$GITHUB_OUTPUT"
fi

exit 0
fi
Expand All @@ -203,16 +206,20 @@ if [[ ! -x "$CACHE_PATH/bin/flutter" ]]; then
fi
fi

{
echo "FLUTTER_ROOT=$CACHE_PATH"
echo "PUB_CACHE=$PUB_CACHE"
} >>"$GITHUB_ENV"
if [ -n "${GITHUB_ENV:-}" ]; then
{
echo "FLUTTER_ROOT=$CACHE_PATH"
echo "PUB_CACHE=$PUB_CACHE"
} >>"$GITHUB_ENV"
fi

{
echo "$CACHE_PATH/bin"
echo "$CACHE_PATH/bin/cache/dart-sdk/bin"
echo "$PUB_CACHE/bin"
} >>"$GITHUB_PATH"
if [ -n "${GITHUB_PATH:-}" ]; then
{
echo "$CACHE_PATH/bin"
echo "$CACHE_PATH/bin/cache/dart-sdk/bin"
echo "$PUB_CACHE/bin"
} >>"$GITHUB_PATH"
fi

if [ "$PRECACHE" = true ]; then
echo "Will run precache..."
Expand Down

0 comments on commit 31d7d29

Please sign in to comment.