Skip to content

Commit f0bd4bf

Browse files
authored
feat: enable windows and macos in CI (#282)
Closes #1
1 parent 0c31c9a commit f0bd4bf

2 files changed

Lines changed: 68 additions & 6 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,25 @@ jobs:
3232
os:
3333
- runner: ubuntu-latest
3434
duckdb-slug: linux-amd64
35-
# Installing GDAL is just too slow, for now. We should cache eventually.
36-
# - runner: macos-latest
37-
# duckdb-slug: osx-universal
38-
# https://github.com/stac-utils/rustac-py/issues/1
39-
# - windows-latest
35+
include:
36+
- python-version: "3.11"
37+
os:
38+
runner: macos-latest
39+
duckdb-slug: osx-universal
4040
steps:
4141
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
4242
with:
4343
submodules: true
4444
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4545
with:
4646
python-version: ${{ matrix.python-version }}
47+
cache-dependency-glob: |
48+
pyproject.toml
49+
uv.lock
4750
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
4851
- name: Install libduckdb
4952
run: |
50-
wget https://github.com/duckdb/duckdb/releases/download/v${{ env.duckdb-version }}/libduckdb-${{ matrix.os.duckdb-slug }}.zip
53+
curl -L -o libduckdb-${{ matrix.os.duckdb-slug }}.zip https://github.com/duckdb/duckdb/releases/download/v${{ env.duckdb-version }}/libduckdb-${{ matrix.os.duckdb-slug }}.zip
5154
mkdir -p ${{ github.workspace }}/opt/duckdb
5255
unzip libduckdb-${{ matrix.os.duckdb-slug }}.zip -d ${{ github.workspace }}/opt/duckdb
5356
- name: Install GDAL
@@ -67,6 +70,25 @@ jobs:
6770
# not worth it to install cairo on macos
6871
if: runner.os == 'ubuntu-latest'
6972
run: uv run mkdocs build --strict
73+
build-windows:
74+
name: Build (Windows)
75+
runs-on: windows-latest
76+
env:
77+
MATURIN_PEP517_ARGS: --features duckdb-bundled
78+
RUSTFLAGS: -C link-arg=Rstrtmgr.lib
79+
steps:
80+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
81+
with:
82+
submodules: true
83+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
84+
with:
85+
python-version: "3.11"
86+
cache-dependency-glob: |
87+
pyproject.toml
88+
uv.lock
89+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
90+
- name: Sync
91+
run: uv sync
7092
import:
7193
name: Import
7294
runs-on: ubuntu-latest

.github/workflows/pypi.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,45 @@ jobs:
114114
name: wheels-macos-${{ matrix.platform.target }}
115115
path: dist
116116

117+
windows:
118+
runs-on: ${{ matrix.platform.runner }}
119+
env:
120+
RUSTFLAGS: -C link-arg=Rstrtmgr.lib
121+
strategy:
122+
matrix:
123+
platform:
124+
- runner: windows-latest
125+
target: x64
126+
- runner: windows-latest
127+
target: x86
128+
steps:
129+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
130+
with:
131+
submodules: true
132+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
133+
with:
134+
cache-dependency-glob: |
135+
pyproject.toml
136+
uv.lock
137+
- name: Install Python
138+
run: uv python install 3.11
139+
- name: Materialize store symlink
140+
shell: bash
141+
run: |
142+
rm python/rustac/store
143+
cp -R _obstore/obstore/python/obstore/store python/rustac/store
144+
- name: Build wheels
145+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1
146+
with:
147+
target: ${{ matrix.platform.target }}
148+
args: --release --out dist -i 3.11 -F pyo3/abi3-py311 -F pyo3/generate-import-lib -F duckdb-bundled
149+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
150+
- name: Upload wheels
151+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
152+
with:
153+
name: wheels-windows-${{ matrix.platform.target }}
154+
path: dist
155+
117156
sdist:
118157
runs-on: ubuntu-latest
119158
steps:
@@ -140,6 +179,7 @@ jobs:
140179
- linux
141180
- musllinux
142181
- macos
182+
- windows
143183
environment:
144184
name: pypi
145185
url: https://pypi.org/p/rustac

0 commit comments

Comments
 (0)