Skip to content

Commit

Permalink
CI(GHActions): Simplify release script a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
phdru committed Feb 27, 2024
1 parent e295aa6 commit 599f821
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions devscripts/CI/ghactions-release
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
#! /usr/bin/env bash
#! /bin/sh
set -e

[[ "$TOXENV" == pypy* ]] && exit 0
case "$TOXENV" in
pypy*) exit 0 ;;
esac

umask 022 &&
chmod -R a+rX . &&
umask 022
chmod -R a+rX .

py=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))")
v=$(echo "$py" | sed 's/\.//') &&
v=$(echo "$py" | sed 's/\.//')

pip install -U pip setuptools readme-renderer twine wheel &&
python setup.py sdist &&
pip install -U pip setuptools readme-renderer twine wheel
python setup.py sdist

if [ -d build ]; then find build -name '*.py[co]' -delete; fi &&
python setup.py build_ext &&
python setup.py build --executable '/usr/bin/env python' &&
python -m compileall build &&
python -O -m compileall build &&
python setup.py bdist_wheel &&
if [ -d build ]; then find build -name '*.py[co]' -delete; fi
python setup.py build_ext
python setup.py build --executable '/usr/bin/env python'
python -m compileall build
python -O -m compileall build
python setup.py bdist_wheel

if [ "$RUNNER_OS" == 'Linux' ]; then
# auditwheel 5.2+ require patchelf 0.14+
Expand All @@ -27,14 +29,14 @@ if [ "$RUNNER_OS" == 'Linux' ]; then
pip install -U typing "auditwheel==2.1.1"
else
pip install -U "auditwheel<5.2"
fi &&
fi

for f in dist/CT3-*-cp$v-*-linux*.whl; do
if [ "$py" == 2.7 ]; then
python3.7 -m auditwheel repair -w dist/ "$f"
else
python -m auditwheel repair -w dist/ "$f"
fi &&
fi
rm -f "$f"
done

Expand All @@ -44,7 +46,7 @@ elif [ "$RUNNER_OS" == 'macOS' ]; then
for f in dist/CT3-*-cp$v-*-macosx*.whl; do
delocate-wheel -v "$f"
done
fi &&
fi

# TWINE_USERNAME / TWINE_PASSWORD / TWINE_REPOSITORY_URL
# must be set in Github Actions settings.
Expand Down

0 comments on commit 599f821

Please sign in to comment.