Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cibuildwheel for pypi workflows #147

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/workflows/push_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ on:
workflow_dispatch:

jobs:
build-wheel:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

name: Build ${{ matrix.python_version }} wheel (x86_64)
runs-on: ubuntu-20.04
env:
CIBW_SKIP: "cp38-* cp39-* pp*"
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"

steps:
- uses: actions/checkout@v4
Expand All @@ -19,19 +24,14 @@ jobs:
fetch-tags: true

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}

- name: Build wheel
run: |
pip${{ matrix.python_version }} install build
python${{ matrix.python_version }} -m build --wheel
- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0

- name: Store the wheel
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
with:
name: python${{ matrix.python_version }}_wheel
path: dist/
name: vhs-decode-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
if-no-files-found: error

create-sdist:
Expand All @@ -46,22 +46,21 @@ jobs:

- name: Create the sdist
run: |
pip3 install build
python3 -m build --sdist
pipx run build --sdist

- name: Store the sdist
uses: actions/upload-artifact@v4
with:
name: source_dist
path: dist/
name: vhs-decode-sdist
path: dist/*.tar.gz
if-no-files-found: error

publish-to-pypi:
name: Publish to PyPI
runs-on: ubuntu-20.04

needs:
- build-wheel
- build-wheels
- create-sdist

environment:
Expand All @@ -75,7 +74,8 @@ jobs:
- name: Download all the artifacts
uses: actions/download-artifact@v4
with:
path: dist/
pattern: vhs-decode-*
path: dist
merge-multiple: true

- name: Publish packages to PyPI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ on:
workflow_dispatch:

jobs:
build-wheel:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

name: Build ${{ matrix.python_version }} wheel (x86_64)
runs-on: ubuntu-20.04
env:
CIBW_SKIP: "cp38-* cp39-* pp*"
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"

steps:
- uses: actions/checkout@v4
Expand All @@ -19,20 +24,14 @@ jobs:
fetch-tags: true

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}

- name: Build wheel
run: |
pip${{ matrix.python_version }} install build
python${{ matrix.python_version }} -m build --wheel
- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0

- name: Store the wheel
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
with:
name: python${{ matrix.python_version }}_wheel
path: dist/
if-no-files-found: error
name: vhs-decode-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

create-sdist:
name: Create source distribution
Expand All @@ -46,22 +45,20 @@ jobs:

- name: Create the sdist
run: |
pip3 install build
python3 -m build --sdist
pipx run build --sdist

- name: Store the sdist
uses: actions/upload-artifact@v4
with:
name: source_dist
path: dist/
if-no-files-found: error
name: vhs-decode-sdist
path: dist/*.tar.gz

publish-to-testpypi:
name: Publish to TestPyPI
runs-on: ubuntu-20.04

needs:
- build-wheel
- build-wheels
- create-sdist

environment:
Expand All @@ -75,7 +72,8 @@ jobs:
- name: Download all the artifacts
uses: actions/download-artifact@v4
with:
path: dist/
pattern: vhs-decode-*
path: dist
merge-multiple: true

- name: Publish packages to TestPyPI
Expand Down
Loading