Skip to content

Merge pull request #206 from maxmind/greg/eng-2058 #206

Merge pull request #206 from maxmind/greg/eng-2058

Merge pull request #206 from maxmind/greg/eng-2058 #206

Workflow file for this run

name: Build and upload to PyPI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published
permissions: {}
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, macos-14, ubuntu-24.04-arm, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- name: Set up QEMU
if: runner.os == 'Linux' && runner.arch == 'X64'
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # 3.6.0
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # 2.23.3
env:
CIBW_BUILD_VERBOSITY: 1
MAXMINDDB_REQUIRE_EXTENSION: 1
# configure cibuildwheel on Linux to build native archs ('auto'),
# and to split the remaining architectures between the x86_64 and
# ARM runners
CIBW_ARCHS_LINUX: ${{ runner.arch == 'X64' && 'auto ppc64le s390x' || 'auto' }}
- uses: actions/upload-artifact@v4
with:
name: maxminddb-whl-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: maxminddb-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
pattern: maxminddb-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # 1.12.4