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

ci: update build #11

Open
wants to merge 4 commits into
base: release-0.2.1
Choose a base branch
from
Open
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
61 changes: 43 additions & 18 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,85 @@ jobs:
strategy:
matrix:
target: [x86_64, aarch64]
manylinux: [auto]
include:
- target: x86_64
manylinux: musllinux_1_1
- target: aarch64
manylinux: musllinux_1_1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: messense/maturin-action@v1
- uses: actions/checkout@v4
- uses: PyO3/maturin-action@v1
with:
manylinux: auto
manylinux: ${{ matrix.manylinux }}
command: build
target: ${{ matrix.target }}
args: --release --sdist -o dist --find-interpreter
# https://github.com/PyO3/maturin-action/issues/56
args: --release --sdist -o dist --interpreter 3.9 3.10 3.11 3.12 pypy3.9 pypy3.10
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels_${{ matrix.target }}_${{ matrix.manylinux }}
path: dist

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: messense/maturin-action@v1
- uses: actions/checkout@v4
- uses: PyO3/maturin-action@v1
with:
command: build
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels_windows
path: dist

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: messense/maturin-action@v1
- uses: actions/checkout@v4
- uses: PyO3/maturin-action@v1
with:
command: build
args: --release -o dist --universal2 --find-interpreter
target: universal2
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels_macos
path: dist

test-release:
name: Test Release
runs-on: ubuntu-latest
needs: [ macos, windows, linux ]
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels_*
merge-multiple: true
path: dist
- name: Test Archive Download
run: |
echo "Testing archive download"
ls -la dist # List the contents to confirm download
Comment on lines +63 to +76
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this job as a sanity test for using the latest version of GH's upload/download artifact actions, as they no longer allow writing to the same archive across multiple jobs. The output of this basically shows us what would be in the dist/ directory in the publish job.

It also lets you easily see the wheels that are generated with this new config, e.g. here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove it once you've had a chance to take a look.


release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ macos, windows, linux ]
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: wheels
pattern: wheels_*
merge-multiple: true
path: dist
- name: Publish to PyPI
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
Expand Down
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=0.13,<0.14"]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

[project]
Expand All @@ -14,11 +14,17 @@ classifiers = [
]
version = "0.2.0"
description = "Python implementation of Shin's method for calculating implied probabilities from bookmaker odds"
author = "Maurice Berk"
author_email = "maurice@mauriceberk.com"
url = "https://github.com/mberk/shin"
authors = [
{name = "Maurice Berk", email = "maurice@mauriceberk.com"},
]
readme = "README.md"

[project.urls]
Repository = "https://github.com/mberk/shin"

[tool.maturin]
python-source = "python"

[tool.mypy]
python_version = "3.9"
packages = ["shin", "tests"]
Expand Down
Loading