forked from databricks/setup-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_release.sh
53 lines (44 loc) · 917 Bytes
/
setup_release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
set -euo pipefail
# Pull latest version from VERSION file if not set.
if [ -z "${VERSION:-}" ]; then
VERSION=$(cat "$(dirname "$0")"/VERSION)
fi
FILE="databricks_cli_$VERSION"
# Include operating system in file name.
case $RUNNER_OS in
Linux)
FILE="${FILE}_linux"
;;
Windows)
FILE="${FILE}_windows"
;;
macOS)
FILE="${FILE}_darwin"
;;
esac
# Include architecture in file name.
case $RUNNER_ARCH in
X86)
FILE="${FILE}_386"
;;
X64)
FILE="${FILE}_amd64"
;;
ARM)
FILE="${FILE}_arm"
;;
ARM64)
FILE="${FILE}_arm64"
;;
esac
# Change into temporary directory.
cd "$RUNNER_TEMP"
# Download release archive.
curl -L -s -O "https://github.com/databricks/cli/releases/download/v${VERSION}/${FILE}.zip"
# Unzip release archive.
unzip -q "${FILE}.zip" -d .bin
# Add databricks to path.
dir=$PWD/.bin
chmod +x "${dir}/databricks"
echo "$dir" >> "$GITHUB_PATH"