mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-18 06:06:55 +00:00

Co-authored-by: Chris Collins <chriscollins3456@gmail.com> Co-authored-by: RyanHolstien <RyanHolstien@users.noreply.github.com>
25 lines
818 B
Bash
Executable File
25 lines
818 B
Bash
Executable File
#!/bin/bash
|
|
set -euxo pipefail
|
|
|
|
if [[ ! ${RELEASE_SKIP_TEST:-} ]]; then
|
|
../gradlew build # also runs tests
|
|
elif [[ ! ${RELEASE_SKIP_INSTALL:-} ]]; then
|
|
../gradlew install
|
|
fi
|
|
|
|
# Check packaging constraint.
|
|
python -c 'import setuptools; where="./src"; assert setuptools.find_packages(where) == setuptools.find_namespace_packages(where), "you seem to be missing or have extra __init__.py files"'
|
|
if [[ ${RELEASE_VERSION:-} ]]; then
|
|
# Replace version with RELEASE_VERSION env variable
|
|
sed -i.bak "s/__version__ = \"1\!0.0.0.dev0\"/__version__ = \"$(echo $RELEASE_VERSION|sed s/-/+/)\"/" src/datahub/__init__.py
|
|
else
|
|
vim src/datahub/__init__.py
|
|
fi
|
|
|
|
rm -rf build dist || true
|
|
python -m build
|
|
if [[ ! ${RELEASE_SKIP_UPLOAD:-} ]]; then
|
|
python -m twine upload 'dist/*'
|
|
fi
|
|
git restore src/datahub/__init__.py
|