Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/build_and_publish_test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ permissions:
env:
AWS_ROLE: arn:aws:iam::213020545630:role/github-runner-role
AWS_REGION: us-west-1
PYTHON_VERSIONS: "3.13 3.12 3.11 3.10"
PYTHON_VERSIONS: '["3.13", "3.12", "3.11", "3.10"]'

defaults:
run:
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ jobs:
]

build_wheels:
name: Build Python wheels
name: Python ${{ matrix.python_version }}
needs: start-self-hosted-runner
runs-on: ${{ needs.start-self-hosted-runner.outputs.label }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
python_version: ${{ fromJSON(inputs.PYTHON_VERSIONS) }}

steps:
- name: Checkout
Expand Down Expand Up @@ -122,20 +127,29 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Build Python wheels
- name: Build Python wheel
run: |
uv python install ${{ inputs.PYTHON_VERSIONS }}
uv python install ${{ matrix.python_version }}

cd ${{ github.workspace }}/oxen-python

for version in ${{ inputs.PYTHON_VERSIONS }}; do
uvx --from 'maturin[patchelf]' maturin build --release --interpreter /root/.local/bin/python${version}
done
uvx --from 'maturin[patchelf]' maturin build --release -v \
--interpreter /root/.local/bin/python${{ matrix.python_version }} \
2>&1 | tee /tmp/build.log

- name: Verify liboxen cache reuse
if: strategy.job-index != 0
run: |
if grep -q "Compiling liboxen" /tmp/build.log; then
echo "::error::liboxen was recompiled! Rust cache reuse failed."
exit 1
fi
echo "liboxen correctly reused from cache."

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ inputs.ARCHITECTURE }}
name: wheels-linux-${{ inputs.ARCHITECTURE }}-py${{ matrix.python_version }}
path: ${{ github.workspace }}/oxen-python/target/wheels/*.whl
retention-days: 1

Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/build_wheels_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ defaults:

jobs:
build_wheels:
name: Build Python wheels
name: Python ${{ matrix.python_version }}
runs-on: macos-15-xlarge
strategy:
fail-fast: false
matrix:
python_version: ${{ fromJSON(inputs.PYTHON_VERSIONS) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -52,21 +56,19 @@ jobs:

- name: Build Python wheels
run: |
uv python install ${{ inputs.PYTHON_VERSIONS }}
uv python install ${{ matrix.python_version }}

cd ${{ github.workspace }}/oxen-python

rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin

for version in ${{ inputs.PYTHON_VERSIONS }}; do
uvx maturin build --release --interpreter /Users/runner/.local/bin/python${version} --target aarch64-apple-darwin
uvx maturin build --release --interpreter /Users/runner/.local/bin/python${version} --target x86_64-apple-darwin
done
uvx maturin build --release --interpreter /Users/runner/.local/bin/python${{ matrix.python_version }} --target aarch64-apple-darwin
uvx maturin build --release --interpreter /Users/runner/.local/bin/python${{ matrix.python_version }} --target x86_64-apple-darwin

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-macos
name: wheels-macos-py${{ matrix.python_version }}
path: ${{ github.workspace }}/oxen-python/target/wheels/*.whl
retention-days: 1
18 changes: 10 additions & 8 deletions .github/workflows/build_wheels_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ jobs:
]

build_wheels:
name: Build Python wheels
name: Python ${{ matrix.python_version }}
needs: start-self-hosted-runner
runs-on: ${{ needs.start-self-hosted-runner.outputs.label }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
python_version: ${{ fromJSON(inputs.PYTHON_VERSIONS) }}
defaults:
run:
shell: powershell
Expand Down Expand Up @@ -122,22 +127,19 @@ jobs:
shared-key: "release-python"
workspaces: "oxen-python -> target"

- name: Build Python wheels
- name: Build Python wheel
run: |
refreshenv
uv python install ${{ inputs.PYTHON_VERSIONS }}
uv python install ${{ matrix.python_version }}

cd ${{ github.workspace }}\oxen-python

$versions = "${{ inputs.PYTHON_VERSIONS }}" -split ' '
foreach ($version in $versions) {
uvx maturin build --release --interpreter "C:\Users\Administrator\AppData\Roaming\uv\python\cpython-$version.*\python.exe"
}
uvx maturin build --release --interpreter "C:\Users\Administrator\AppData\Roaming\uv\python\cpython-${{ matrix.python_version }}.*\python.exe"

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ inputs.ARCHITECTURE }}
name: wheels-windows-${{ inputs.ARCHITECTURE }}-py${{ matrix.python_version }}
path: ${{ github.workspace }}\oxen-python\target\wheels\*.whl
retention-days: 1

Expand Down