Test #11
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: Wheel build | |
# on: | |
# release: | |
# types: [created] | |
# workflow_dispatch: | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: write # to create GitHub release (softprops/action-gh-release) | |
jobs: | |
sdist: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Python dependencies | |
run: python -m pip install -r requirements.txt | |
- name: Build sdist | |
run: make sdist | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: dist/*.tar.gz | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: dist/*.tar.gz | |
Linux: | |
runs-on: ubuntu-latest | |
strategy: | |
# Allows for matrix sub-jobs to fail without canceling the rest | |
fail-fast: false | |
matrix: | |
image: | |
# - manylinux2014_x86_64 | |
# - manylinux2014_i686 | |
- manylinux_2_28_x86_64 | |
# - manylinux_2_24_i686 | |
#- manylinux_2_28_aarch64 | |
# - musllinux_1_1_x86_64 | |
#- musllinux_1_1_aarch64 | |
#- manylinux_2_24_ppc64le | |
#- manylinux_2_24_ppc64le | |
#- manylinux_2_24_s390x | |
pyversion: ["cp310-cp310", "cp311-cp311", "cp312-cp312"] | |
#include: | |
# - image: manylinux_2_28_aarch64 | |
# pyversion: "cp311*" | |
# - image: manylinux_2_28_aarch64 | |
# pyversion: "cp312*" | |
# - image: musllinux_1_1_aarch64 | |
# pyversion: "cp311*" | |
# - image: musllinux_1_1_aarch64 | |
# pyversion: "cp312*" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: python -m pip install -r requirements.txt | |
- name: Build Linux wheels | |
run: make USE_BUNDLE=true sdist wheel_${{ matrix.image }} | |
env: { PYTHON_BUILD_VERSION: "${{ matrix.pyversion }}" } | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: wheelhouse_*/*-m*linux*.whl # manylinux / musllinux | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ matrix.image }}-${{ matrix.pyversion }} | |
path: wheelhouse_${{ matrix.image}}/*-m*linux*.whl | |
if-no-files-found: ignore | |
non-Linux: | |
strategy: | |
# Allows for matrix sub-jobs to fail without canceling the rest | |
fail-fast: false | |
matrix: | |
os: | |
- macos-latest | |
- windows-latest | |
pyversion: | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
runs-on: ${{ matrix.os }} | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 11.0 | |
LUPA_WITH_LUA_DLOPEN: ${{ startsWith(matrix.os, 'windows') && 'false' || 'true' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
- name: Install MacOS dependencies | |
if: startsWith(matrix.os, 'mac') | |
run: | | |
brew install automake libtool | |
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize | |
- name: Install dependencies | |
run: python -m pip install setuptools wheel -r requirements.txt | |
- name: Build wheels | |
run: | | |
set USE_BUNDLE=true | |
python setup.py --with-cython sdist ${{ contains(matrix.pyversion, '3.') && 'build_ext -j6' || '' }} bdist_wheel | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: dist/*.whl | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ matrix.os }}-${{ matrix.pyversion }} | |
path: dist/*.whl | |
if-no-files-found: ignore | |
# publish-to-pypi: | |
# name: Publish Python π distribution π¦ to PyPI | |
# needs: | |
# - Linux | |
# - non-Linux | |
# runs-on: ubuntu-latest | |
# environment: | |
# name: pypi | |
# url: https://pypi.org/p/randovania-lupa | |
# permissions: | |
# id-token: write # IMPORTANT: mandatory for trusted publishing | |
# steps: | |
# - name: Download all the dists | |
# uses: actions/download-artifact@v4 | |
# with: | |
# merge-multiple: true | |
# path: dist/ | |
# - name: Publish distribution π¦ to PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
publish-to-testpypi: | |
name: Publish Python π distribution π¦ to TestPyPI | |
needs: | |
- Linux | |
- non-Linux | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/randovania-lupa | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: dist/ | |
- name: Publish distribution π¦ to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ |