-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·58 lines (45 loc) · 1.72 KB
/
setup.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
54
55
56
57
58
#!/usr/bin/env bash
set -e;
NEED_PYTEST=$1;
THIS_SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`; # /home/runner/work/_actions/KOLANICH-GHActions/typical-python-workflow/master
echo "This script is $THIS_SCRIPT_DIR";
THIS_SCRIPT_DIR=`realpath "${THIS_SCRIPT_DIR}"`;
echo "This script is $THIS_SCRIPT_DIR";
ACTIONS_DIR=`realpath "$THIS_SCRIPT_DIR/../../.."`;
AUTHOR_NAMESPACE=KOLANICH-GHActions;
SETUP_ACTION_REPO=$AUTHOR_NAMESPACE/setup-python;
GIT_PIP_ACTION_REPO=$AUTHOR_NAMESPACE/git-pip;
APT_ACTION_REPO=$AUTHOR_NAMESPACE/git-pip;
SETUP_ACTION_DIR=$ACTIONS_DIR/$SETUP_ACTION_REPO/master;
GIT_PIP_ACTION_DIR=$ACTIONS_DIR/$GIT_PIP_ACTION_REPO/master;
APT_ACTION_DIR=$ACTIONS_DIR/$APT_ACTION_REPO/master;
if [ -d "$SETUP_ACTION_DIR" ]; then
:
else
git clone --depth=1 https://github.com/$SETUP_ACTION_REPO $SETUP_ACTION_DIR;
fi;
if [ -d "$GIT_PIP_ACTION_DIR" ]; then
:
else
git clone --depth=1 https://github.com/$GIT_PIP_ACTION_REPO $GIT_PIP_ACTION_DIR;
fi;
if [ -d "$APT_ACTION_DIR" ]; then
:
else
git clone --depth=1 https://github.com/$APT_ACTION_REPO $APT_ACTION_DIR;
fi;
bash $SETUP_ACTION_DIR/action.sh 0;
bash $GIT_PIP_ACTION_DIR/action.sh $THIS_SCRIPT_DIR/pythonPackagesToInstallFromGit.txt;
bash $APT_ACTION_DIR/action.sh $THIS_SCRIPT_DIR/pythonPackagesToInstallFromGit.txt;
echo "##[group] Getting package name";
PACKAGE_NAME=`python3 $THIS_SCRIPT_DIR/getPackageName.py`;
echo "##[endgroup]";
echo "##[group] Building the main package";
python3 -m build -xnw .;
PACKAGE_FILE_NAME=$PACKAGE_NAME-0.CI-py3-none-any.whl;
PACKAGE_FILE_PATH=./dist/$PACKAGE_FILE_NAME;
mv ./dist/*.whl $PACKAGE_FILE_PATH;
echo "##[endgroup]";
echo "##[group] Installing the main package";
sudo pip3 install --upgrade $PACKAGE_FILE_PATH;
echo "##[endgroup]";