Skip to content

Commit

Permalink
Fix builds on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Oct 12, 2023
1 parent 0114c9a commit 59e3595
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 56 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ name: build
on: workflow_dispatch

env:
MATURIN_VERSION: 1.2.3
MATURIN_VERSION: 1.3.0
PY_ALL: 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10

jobs:
wheel-unix:
wheels:
name: wheel ${{ matrix.platform || matrix.os }}(${{ matrix.target }}) - ${{ matrix.manylinux || 'auto' }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
os: [ubuntu, macos, windows]
target: [x86_64, aarch64]
manylinux: [auto]
include:
Expand Down Expand Up @@ -41,30 +41,14 @@ jobs:
- uses: pyo3/maturin-action@v1
with:
maturin-version: v${{ env.MATURIN_VERSION }}
rust-toolchain: stable
command: build
args: --release --interpreter ${{ matrix.interpreter || env.PY_ALL }}
args: --release --out dist --interpreter ${{ matrix.interpreter || env.PY_ALL }}
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
container: ${{ matrix.container }}
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels

wheel-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: pyo3/maturin-action@v1
with:
maturin-version: v${{ env.MATURIN_VERSION }}
command: build
args: --release --interpreter ${{ env.PY_ALL }}
target: x86_64
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels
name: dist
path: dist
47 changes: 15 additions & 32 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,22 @@ jobs:
- uses: pyo3/maturin-action@v1
with:
maturin-version: v${{ env.MATURIN_VERSION }}
command: build
args: --release --sdist --interpreter 3.10
target: x64
manylinux: off
container: off
rust-toolchain: stable
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels/*.tar.gz
name: dist
path: dist

wheel-unix:
wheels:
name: wheel ${{ matrix.platform || matrix.os }}(${{ matrix.target }}) - ${{ matrix.manylinux || 'auto' }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
os: [ubuntu, macos, windows]
target: [x86_64, aarch64]
manylinux: [auto]
include:
Expand Down Expand Up @@ -66,41 +64,26 @@ jobs:
- uses: pyo3/maturin-action@v1
with:
maturin-version: v${{ env.MATURIN_VERSION }}
rust-toolchain: stable
command: build
args: --release --interpreter ${{ matrix.interpreter || env.PY_ALL }}
args: --release --out dist --interpreter ${{ matrix.interpreter || env.PY_ALL }}
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
container: ${{ matrix.container }}
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels

wheel-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: pyo3/maturin-action@v1
with:
maturin-version: v${{ env.MATURIN_VERSION }}
command: build
args: --release --interpreter ${{ env.PY_ALL }}
target: x86_64
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels
name: dist
path: dist

release:
runs-on: ubuntu-latest
needs: [ sdist, wheel-unix, wheel-win ]
needs: [ sdist, wheels ]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
name: dist
path: dist
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -110,4 +93,4 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pip install --upgrade pip twine
twine upload --skip-existing *
twine upload --skip-existing dist/*
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ aes = { version = "0.8" }
cfb8 = { version = "0.8" }
cfb-mode = { version = "0.8" }
ctr = { version = "0.9" }
pyo3 = { version = "=0.20", features = ["extension-module"] }
pyo3 = { version = "=0.20", features = ["extension-module", "generate-import-lib"] }
ring = { version = "0.16" }

[build-dependencies]
Expand Down

0 comments on commit 59e3595

Please sign in to comment.