Skip to content

Commit

Permalink
Merge branch 'aarch64'
Browse files Browse the repository at this point in the history
* aarch64:
  CI(GHActions): Build and publish wheels on Linux/aarch64
  • Loading branch information
phdru committed Feb 28, 2024
2 parents 371f803 + 1ed9cc0 commit e116c34
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 35 deletions.
50 changes: 44 additions & 6 deletions .github/workflows/test-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
run-tests:
env:
not_in_conda: "[]"
not_in_aarch64: "['3.5', 'pypy3.7']"

strategy:
matrix:
Expand All @@ -32,7 +33,6 @@ jobs:
runs-on: ${{ matrix.os }}

steps:

# Setup Python/pip
- uses: actions/checkout@v4
- uses: s-weigand/setup-conda@v1
Expand All @@ -43,10 +43,12 @@ jobs:
# Python 3.7 is needed for ghactions-release script
- name: Install additional Python 3.7
run: |
conda create -n py37 python=3.7
conda create -n py37 --yes python=3.7
py37_prefix="`echo $CONDA_PREFIX | sed 's/__setup_conda/py37/'`"
ln -s "$py37_prefix/bin/python" "$CONDA_PREFIX/bin/python3.7"
ln -s "$py37_prefix/bin/pip" "$CONDA_PREFIX/bin/pip3.7"
python3.7 --version
pip3.7 --version
shell: bash
if: ${{ matrix.python-version == '2.7' && runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/') }}
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -102,16 +104,52 @@ jobs:
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
if: ${{ runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/') }}
if: ${{ !startsWith(matrix.python-version, 'pypy') && runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/') }}
- name: Build and publish wheel on w32
run: |
pip install -U pip setuptools twine wheel
python setup.py bdist_wheel
twine upload --disable-progress-bar --skip-existing dist\*
if: ${{ runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/') }}
if: ${{ !startsWith(matrix.python-version, 'pypy') && runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/') }}
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
- name: Build and publish wheel on Linux/aarch64
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu22.04
env: |
PY_VER: "${{ matrix.python-version }}"
RUNNER_OS: ${{ runner.os }}
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
install: |
set -ex
apt-get update -q -y
apt-get install -q -y curl gcc patchelf
run: |
set -ex
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh -b -u -p "$HOME"/miniforge3
source "$HOME"/miniforge3/etc/profile.d/conda.sh
#conda update -n base -c conda-forge --yes conda
pyv="`echo $PY_VER | sed 's/\.//'`"
conda create -n py$pyv --yes python=$PY_VER
conda activate py$pyv
python --version
python -m pip || python -m ensurepip --default-pip --upgrade
python -m pip install --upgrade pip setuptools wheel
pip --version
if [ $PY_VER = 2.7 ]; then
conda create -n py37 --yes python=3.7
ln -s "$HOME"/miniforge3/envs/py37/bin/python "$HOME"/miniforge3/envs/py27/bin/python3.7
ln -s "$HOME"/miniforge3/envs/py37/bin/pip "$HOME"/miniforge3/envs/py27/bin/pip3.7
python3.7 --version
pip3.7 --version
fi
exec devscripts/CI/ghactions-release
if: ${{ !contains(fromJSON(env.not_in_aarch64), matrix.python-version) && runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') }}
- name: Publish wheel to Releases
uses: ncipollo/release-action@v1
with:
Expand All @@ -121,8 +159,8 @@ jobs:
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
prerelease: false
prerelease: true
replacesArtifacts: false
skipIfReleaseExists: false
updateOnlyUnreleased: false
if: ${{ startsWith(github.ref, 'refs/tags/') }}
if: ${{ !startsWith(matrix.python-version, 'pypy') && startsWith(github.ref, 'refs/tags/') }}
8 changes: 5 additions & 3 deletions ANNOUNCE.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Hello!

I'm pleased to announce version 3.3.4a0, the first alpha release
I'm pleased to announce version 3.3.4a3, an alpha release
of release 3.3.4 of branch 3.3 of CheetahTemplate3.


What's new in CheetahTemplate3
==============================

The contributors for this release are ...
CI:

- GHActions: Build and publish wheels on Linux/aarch64.


What is CheetahTemplate3
Expand All @@ -26,7 +28,7 @@ Site:
https://cheetahtemplate.org/

Download:
https://pypi.org/project/CT3/3.3.4a0
https://pypi.org/project/CT3/3.3.4a3

News and changes:
https://cheetahtemplate.org/news.html
Expand Down
4 changes: 2 additions & 2 deletions Cheetah/Version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

Version = '3.3.4a0'
VersionTuple = (3, 3, 4, 'alpha', 0)
Version = '3.3.4a3'
VersionTuple = (3, 3, 4, 'alpha', 3)

MinCompatibleVersion = '3.0.0a1'
MinCompatibleVersionTuple = (3, 0, 0, 'alpha', 1)
Expand Down
1 change: 1 addition & 0 deletions LATEST-CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CI(GHActions): Build and publish wheels on Linux/aarch64.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Cheetah Template 3.3.4a0
Cheetah Template 3.3.4a3
========================

Cheetah3 is a free and open source (MIT) Python template engine.
Expand Down
48 changes: 25 additions & 23 deletions devscripts/CI/ghactions-release
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
#! /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
if [ "$RUNNER_OS" = 'Linux' ]; then
# auditwheel 5.2+ require patchelf 0.14+
if [ "$py" == 2.7 ]; then
if [ "$py" = 2.7 ]; then
pip3.7 install -U "auditwheel<5.2"
elif [ "$py" == 3.4 ]; then
elif [ "$py" = 3.4 ]; 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
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

elif [ "$RUNNER_OS" == 'macOS' ]; then
elif [ "$RUNNER_OS" = 'macOS' ]; then

pip install -U delocate
for f in dist/CT3-*-cp$v-*-macosx*.whl; do
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
4 changes: 4 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ News
Development (master)
--------------------

CI:

- GHActions: Build and publish wheels on Linux/aarch64.

3.3.3 (2023-10-22)
------------------

Expand Down

0 comments on commit e116c34

Please sign in to comment.