-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
47 lines (33 loc) · 1.17 KB
/
build.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
#!/usr/bin/env bash
set -e
ARCH=$(uname -m)
HOMEBREW_PREFIX="/usr/local"
echo ""
echo "run 'mkdir /usr/local/valet-sh'"
sudo mkdir /usr/local/valet-sh
sudo chmod 777 /usr/local/valet-sh
echo ""
echo "run '/usr/bin/python3 -m venv venv'"
cd /usr/local/valet-sh
if [[ "$OSTYPE" == "darwin"* ]] && [[ "$ARCH" == "arm"* ]]; then
HOMEBREW_PREFIX="/opt/homebrew"
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
# check if brew is installed
if ! command -v ${HOMEBREW_PREFIX}/bin/brew &> /dev/null
then
echo " - brew could not be found. Installing..."
yes | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export CPPFLAGS=-I${HOMEBREW_PREFIX}/opt/openssl/include
export LDFLAGS=-L${HOMEBREW_PREFIX}/opt/openssl/lib
fi
echo " - install required brew packages"
${HOMEBREW_PREFIX}/bin/brew install openssl rust [email protected]
${HOMEBREW_PREFIX}/bin/python3.10 -m venv venv
else
/usr/bin/python3 -m venv venv
fi
echo ""
echo "run 'pip3 install -r ${GITHUB_WORKSPACE}/requirements.txt'"
source venv/bin/activate
pip3 install -r ${GITHUB_WORKSPACE}/requirements.txt