-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·30 lines (25 loc) · 945 Bytes
/
release.sh
File metadata and controls
executable file
·30 lines (25 loc) · 945 Bytes
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
#!/usr/bin/env bash
# release.sh - Sets up a release venv with twine and runs release.py
set -e
VENV_DIR=".release-venv"
PYTHON="${PYTHON:-python}"
# Determine activate script path (Windows uses Scripts/, Unix uses bin/)
ACTIVATE="$VENV_DIR/bin/activate"
[ -f "$VENV_DIR/Scripts/activate" ] && ACTIVATE="$VENV_DIR/Scripts/activate"
if [ ! -f "$ACTIVATE" ]; then
echo "Creating release venv in $VENV_DIR ..."
rm -rf "$VENV_DIR"
"$PYTHON" -m venv --without-pip --system-site-packages "$VENV_DIR"
# Refresh activate path after creation
ACTIVATE="$VENV_DIR/bin/activate"
[ -f "$VENV_DIR/Scripts/activate" ] && ACTIVATE="$VENV_DIR/Scripts/activate"
# shellcheck disable=SC1090
source "$ACTIVATE"
python -m ensurepip --upgrade
else
# shellcheck disable=SC1090
source "$ACTIVATE"
fi
pip install --quiet --upgrade pip setuptools wheel twine
pip install --quiet -r requirements.txt
python release.py "$@"