Rework packages workflow #90
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: Build Python Packages | |
on: | |
push: | |
# tags: | |
# - "v*" | |
jobs: | |
windows-packages: | |
name: "Build Windows Packages" | |
strategy: | |
matrix: | |
os: | |
- "windows-latest" | |
python-version: | |
- "pypy3" | |
runs-on: "${{ matrix.os }}" | |
steps: | |
# Avoid letting Windows newlines confusing milksnake. | |
- run: "git config --global core.autocrlf false" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# Fetch all history | |
fetch-depth: 0 | |
submodules: "recursive" | |
fetch-tags: true | |
- name: Get Packaging Dependencies | |
run: | | |
pip install wheel twine | |
- name: Build Packages | |
run: | | |
python setup.py bdist_wheel | |
- name: Upload Packages | |
env: | |
TWINE_USERNAME: "__token__" | |
# Secret PyPI API key configured in the GitHub web interface. Visit | |
# the project Settings page, find Secrets beneath it. | |
TWINE_PASSWORD: "${{ secrets.exarkun_pypi_api_key }}" | |
run: | | |
python -m twine upload --repository pypi dist/* | |
if: startsWith(github.ref, 'refs/tags/v') | |
manylinux2010-packages: | |
# Build manylinux2010 packages because the tooling for building | |
# manylinux2014 packages does not support Python 2.7. | |
name: "Build manylinux2010 Packages" | |
strategy: | |
matrix: | |
os: | |
- "ubuntu-24.04" | |
python-version: | |
- "pypy3" | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# Fetch all history | |
fetch-depth: 0 | |
submodules: "recursive" | |
fetch-tags: true | |
# wheel isn't required but twine is | |
- name: Get Packaging Dependencies | |
run: | | |
pip install wheel twine | |
- name: Build a binary wheel and a source tarball | |
uses: LeastAuthority/python-wheels-manylinux-build@master | |
with: | |
python-versions: "cp37-cp37m" | |
install-extra-requirements: ".github/workflows/install-rust.sh" | |
- name: Put packages where they can be found | |
run: | | |
mkdir -p dist | |
cp wheelhouse/*manylinux2010*.whl dist/ | |
- name: Upload Packages | |
env: | |
TWINE_USERNAME: "__token__" | |
# Secret PyPI API key configured in the GitHub web interface. Visit | |
# the project Settings page, find Secrets beneath it. | |
TWINE_PASSWORD: "${{ secrets.exarkun_pypi_api_key }}" | |
run: | | |
python -m twine upload --repository pypi dist/* | |
if: startsWith(github.ref, 'refs/tags/v') |