3.1.2b2 #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create wheel | |
on: | |
# run when a release has been created | |
release: | |
types: [created] | |
env: | |
# set this so the falcon test uses the installed version and not the local one | |
PYTHONNOUSERSITE: 1 | |
# comment TWINE_REPOSITORY_URL to use the real pypi. NOTE: change also the secret used in TWINE_PASSWORD | |
# TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ | |
jobs: | |
# four jobs are defined make-wheel-win-osx, make-wheel-linux, make-source-dist and make-emulated-wheels | |
# the wheels jobs do the the same steps, but linux wheels need to be build to target manylinux | |
make-wheel-win-osx: | |
needs: make-source-dist | |
name: ${{ matrix.python-version }}-${{ matrix.architecture }}-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- "windows-latest" | |
- "macos-latest" | |
python-version: | |
- "3.6" | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
architecture: | |
- x64 | |
fail-fast: false | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.architecture }} | |
- name: Create wheel | |
# `--no-deps` is used to only generate the wheel for the current library. | |
# Redundant in falcon since it has no dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip --version | |
pip install 'setuptools>=47' 'wheel>=0.34' | |
pip wheel -w dist -v --no-deps . | |
- name: Check created wheel | |
# - install the created wheel without using the pypi index | |
# - check the cython extension | |
# - runs the tests | |
run: | | |
pip install tox | |
tox -e wheel_check -- ${{ matrix.pytest-extra }} | |
- name: Upload wheels to release | |
# upload the generated wheels to the github release | |
uses: AButler/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
files: 'dist/*.whl' | |
- name: Publish wheel | |
# the action https://github.com/marketplace/actions/pypi-publish runs only on linux and we cannot specify | |
# additional options | |
env: | |
TWINE_USERNAME: __token__ | |
# replace TWINE_PASSWORD with token for real pypi | |
# TWINE_PASSWORD: ${{ secrets.test_pypi_token }} | |
TWINE_PASSWORD: ${{ secrets.pypi_token }} | |
run: | | |
pip install -U twine | |
twine upload --skip-existing dist/* | |
make-wheel-linux: | |
needs: make-source-dist | |
# see also comments in the make-wheel-win-osx job for details on the steps | |
name: ${{ matrix.python-version }}-${{ matrix.architecture }}-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- "ubuntu-latest" | |
python-version: | |
# the versions are <python tag>-<abi tag> as specified in PEP 425. | |
- cp37-cp37m | |
- cp38-cp38 | |
- cp39-cp39 | |
- cp310-cp310 | |
- cp311-cp311 | |
- cp312-cp312 | |
architecture: | |
- x64 | |
fail-fast: false | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Get python version | |
id: linux-py-version | |
env: | |
py_tag: ${{ matrix.python-version }} | |
run: | | |
platform=${py_tag%%-*} | |
version=${platform:2:1}.${platform:3:3} | |
echo $version | |
echo "::set-output name=python-version::$version" | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ steps.linux-py-version.outputs.python-version }} | |
architecture: ${{ matrix.architecture }} | |
- name: Create wheel for manylinux 2014 | |
uses: RalfG/[email protected]_x86_64 | |
# this action generates 2 wheels in dist/. linux, manylinux2014 | |
with: | |
# Remove previous original wheel just to be sure it is recreated. Should not be needed | |
pre-build-command: "rm -f ./dist/*-linux*.whl" | |
python-versions: ${{ matrix.python-version }} | |
build-requirements: "setuptools>=47 wheel>=0.34" | |
pip-wheel-args: "-w ./dist -v --no-deps" | |
- name: Check created wheel | |
# - install the created wheel without using the pypi index | |
# - check the cython extension | |
# - runs the tests | |
run: | | |
pip install tox | |
tox -e wheel_check -- ${{ matrix.pytest-extra }} | |
- name: Upload wheels to release | |
# upload the generated wheels to the github release | |
uses: AButler/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
files: 'dist/*manylinux*' | |
- name: Publish wheel | |
# We upload all manylinux wheels. pip will download the appropriate one according to the system. | |
env: | |
TWINE_USERNAME: __token__ | |
# replace TWINE_PASSWORD with token for real pypi | |
# TWINE_PASSWORD: ${{ secrets.test_pypi_token }} | |
TWINE_PASSWORD: ${{ secrets.pypi_token }} | |
run: | | |
pip install -U twine | |
twine upload --skip-existing dist/*manylinux* | |
make-source-dist: | |
# see also comments in the make-wheel-win-osx job for details on the steps | |
name: sdist-${{ matrix.python-version }}-${{ matrix.architecture }}-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- "ubuntu-latest" | |
python-version: | |
- "3.10" | |
architecture: | |
- x64 | |
fail-fast: false | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.architecture }} | |
- name: Create sdist | |
run: | | |
python -m pip install --upgrade pip | |
pip --version | |
pip install setuptools>=47 wheel>=0.34 | |
python setup.py sdist --dist-dir dist | |
python .github/workflows/scripts/verify_tag.py dist | |
- name: Upload wheels to release | |
# upload the generated wheels to the github release | |
uses: AButler/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
files: 'dist/*.tar.gz' | |
- name: Publish sdist | |
env: | |
TWINE_USERNAME: __token__ | |
# replace TWINE_PASSWORD with token for real pypi | |
# TWINE_PASSWORD: ${{ secrets.test_pypi_token }} | |
TWINE_PASSWORD: ${{ secrets.pypi_token }} | |
run: | | |
pip install -U twine | |
twine upload --skip-existing dist/* | |
make-emulated-wheels: | |
needs: make-source-dist | |
# see also comments in the make-wheel-linux job for details on the steps | |
name: ${{ matrix.python-version }}-${{ matrix.architecture }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: | |
- "ubuntu-latest" | |
python-version: | |
# the versions are <python tag>-<abi tag> as specified in PEP 425. | |
- cp37-cp37m | |
- cp38-cp38 | |
- cp39-cp39 | |
- cp310-cp310 | |
- cp311-cp311 | |
- cp312-cp312 | |
architecture: | |
- aarch64 | |
- s390x | |
fail-fast: false | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Cache wheels | |
uses: actions/cache@v3 | |
with: | |
path: .pip | |
key: ${{ matrix.python-version }}-${{ matrix.architecture }}-pip-${{ hashFiles('requirements/tests') }} | |
- name: Set up emulation | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
- name: Create wheel for manylinux 2014 for arm | |
if: ${{ matrix.architecture == 'aarch64' }} | |
uses: RalfG/[email protected]_aarch64 | |
# this action generates 2 wheels in dist/. linux, manylinux2014 | |
with: | |
python-versions: ${{ matrix.python-version }} | |
build-requirements: "setuptools>=47 wheel>=0.34" | |
pip-wheel-args: "-w ./dist -v --no-deps" | |
- name: Check created wheel for arm | |
if: ${{ matrix.architecture == 'aarch64' }} | |
uses: docker://quay.io/pypa/manylinux2014_aarch64 | |
env: | |
PIP_CACHE_DIR: /github/workspace/.pip/ | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
with: | |
args: | | |
bash -c " | |
export PATH=/opt/python/${{ matrix.python-version }}/bin:$PATH && | |
pip install tox 'pip>=20' && | |
tox -e wheel_check -- ${{ matrix.pytest-extra }} | |
" | |
- name: Create wheel for manylinux 2014 for s390x | |
if: ${{ matrix.architecture == 's390x' }} | |
uses: RalfG/[email protected]_s390x | |
# this action generates 2 wheels in dist/. linux, manylinux2014 | |
with: | |
python-versions: ${{ matrix.python-version }} | |
build-requirements: "setuptools>=47 wheel>=0.34" | |
pip-wheel-args: "-w ./dist -v --no-deps" | |
- name: Check created wheel for s390x | |
if: ${{ matrix.architecture == 's390x' }} | |
uses: docker://quay.io/pypa/manylinux2014_s390x | |
env: | |
PIP_CACHE_DIR: /github/workspace/.pip/ | |
with: | |
args: | | |
bash -c " | |
export PATH=/opt/python/${{ matrix.python-version }}/bin:$PATH && | |
pip install tox 'pip>=20' && | |
tox -e wheel_check -- ${{ matrix.pytest-extra }} | |
" | |
- name: Upload wheels to release | |
# upload the generated wheels to the github release | |
uses: AButler/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
files: 'dist/*manylinux*' | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
architecture: "x64" | |
- name: Publish wheel | |
env: | |
TWINE_USERNAME: __token__ | |
# replace TWINE_PASSWORD with token for real pypi | |
# TWINE_PASSWORD: ${{ secrets.test_pypi_token }} | |
TWINE_PASSWORD: ${{ secrets.pypi_token }} | |
run: | | |
pip install -U twine | |
twine upload --skip-existing dist/*manylinux* |