Skip to content

build

build #9

Workflow file for this run

name: build
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: '3.12'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build wheels
run: |
python -m pip install --upgrade cibuildwheel
cibuildwheel --output-dir wheelhouse --prerelease-pythons
- name: Add sdist
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade pip build
python -m build . --sdist -o wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cx-logging-${{ matrix.os }}
path: wheelhouse
publish:
name: Publish package to PyPI
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
needs:
- build_wheels
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/cx-Logging
permissions:
id-token: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Join files to upload
run: |
mkdir -p wheelhouse
mv artifacts/cx-logging-*/* wheelhouse/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse/
skip-existing: true
verbose: true