v1.2.7 (new keys) (#14) #78
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: Python | |
on: | |
release: | |
types: [released] | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
FORCE_COLOR: 3 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test_python: | |
if: '!cancelled()' | |
name: Test ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.7, 3.11] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install bindings | |
run: python3 -m pip install -U .[test] | |
- name: Test | |
run: pytest . | |
build_wheels: | |
if: github.repository == 'es3n1n/re-unplayplay' && github.event_name == 'release' | |
name: Build ${{ matrix.os }} wheels | |
needs: test_python | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: astral-sh/setup-uv@v3 | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: all | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.21.1 | |
env: | |
CIBW_SKIP: 'cp36-* *-musllinux_* pp3*' # we are not supporting py3.6 | |
CIBW_TEST_SKIP: '*-win_arm64' | |
# build native archs ('auto'), and some emulated ones | |
CIBW_ARCHS_LINUX: auto aarch64 | |
CIBW_ARCHS_WINDOWS: auto ARM64 | |
- name: Check wheels | |
run: uvx twine check --strict wheelhouse/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: ./wheelhouse/*.whl | |
name: pybuild-wheels-${{ matrix.os }} | |
retention-days: 1 | |
build_sdist: | |
if: github.repository == 'es3n1n/re-unplayplay' && github.event_name == 'release' | |
name: Build sdist | |
runs-on: ubuntu-latest | |
needs: test_python | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Build sdist | |
run: pipx run build --sdist | |
- name: Check metadata | |
run: pipx run twine check --strict dist/* | |
- name: Upload sdist | |
if: github.event_name == 'release' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pybuild-sdist | |
path: ./dist/*.tar.gz | |
retention-days: 1 | |
publish: | |
needs: [build_sdist, build_wheels] | |
name: Publish to PyPI | |
if: github.repository == 'es3n1n/re-unplayplay' && github.event_name == 'release' | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- name: Download dist/wheels | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
pattern: pybuild-* | |
merge-multiple: true | |
- name: List dist | |
run: ls -R dist/* | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |