diff --git a/.github/workflows/test-publish.yaml b/.github/workflows/test-publish.yaml index 25966af3..c30103b6 100644 --- a/.github/workflows/test-publish.yaml +++ b/.github/workflows/test-publish.yaml @@ -9,6 +9,7 @@ jobs: run-tests: env: not_in_conda: "[]" + not_in_aarch64: "['3.5', 'pypy3.7']" strategy: matrix: @@ -32,7 +33,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - # Setup Python/pip - uses: actions/checkout@v4 - uses: s-weigand/setup-conda@v1 @@ -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 @@ -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: @@ -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/') }} diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst index 8b14eaec..8f0bd7e0 100644 --- a/ANNOUNCE.rst +++ b/ANNOUNCE.rst @@ -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 @@ -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 diff --git a/Cheetah/Version.py b/Cheetah/Version.py index bd943e82..d39e08fa 100755 --- a/Cheetah/Version.py +++ b/Cheetah/Version.py @@ -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) diff --git a/LATEST-CHANGES.rst b/LATEST-CHANGES.rst index e69de29b..9b5bcb5c 100644 --- a/LATEST-CHANGES.rst +++ b/LATEST-CHANGES.rst @@ -0,0 +1 @@ +CI(GHActions): Build and publish wheels on Linux/aarch64. diff --git a/README.rst b/README.rst index f423d528..20efcc97 100644 --- a/README.rst +++ b/README.rst @@ -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. diff --git a/devscripts/CI/ghactions-release b/devscripts/CI/ghactions-release index 990f6772..ecb7373e 100755 --- a/devscripts/CI/ghactions-release +++ b/devscripts/CI/ghactions-release @@ -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. diff --git a/docs/news.rst b/docs/news.rst index 4f2d7d7c..86aed39c 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -4,6 +4,10 @@ News Development (master) -------------------- +CI: + + - GHActions: Build and publish wheels on Linux/aarch64. + 3.3.3 (2023-10-22) ------------------