|
30 | 30 | - { os: macos, runs-on: "macos-15-intel", target: x86_64-apple-darwin } |
31 | 31 | - { os: ubuntu, runs-on: "ubuntu-latest", target: aarch64-unknown-linux-gnu } |
32 | 32 | - { os: ubuntu, runs-on: "ubuntu-latest", target: x86_64-unknown-linux-gnu } |
| 33 | + - { os: windows, runs-on: "windows-latest", target: x86_64-pc-windows-msvc } |
33 | 34 | steps: |
34 | 35 | - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
35 | 36 | with: |
|
46 | 47 | tool: cargo-edit@0.13.10 |
47 | 48 |
|
48 | 49 | - name: Cargo Set Version |
| 50 | + shell: bash |
49 | 51 | run: | |
50 | 52 | cargo set-version --workspace ${{ inputs.version }} |
51 | 53 |
|
|
56 | 58 | - name: Set Python extension version pins |
57 | 59 | env: |
58 | 60 | VERSION: ${{ inputs.version }} |
| 61 | + shell: bash |
59 | 62 | run: | |
60 | | - python3 - <<'PY' |
| 63 | + # Not every runner image puts a `python3` on PATH; Windows may only have `python`. |
| 64 | + PYTHON="$(command -v python3 || command -v python)" |
| 65 | + "$PYTHON" - <<'PY' |
61 | 66 | import os |
62 | 67 | import re |
63 | 68 | from pathlib import Path |
|
79 | 84 |
|
80 | 85 | - name: Set up Python |
81 | 86 | uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7 |
82 | | - # Latest macOS doesn't allow maturin to install stuff into the global Python interpreter |
83 | | - if: "${{ matrix.target.runs-on == 'macos-latest' }}" |
| 87 | + # Latest macOS doesn't allow maturin to install stuff into the global Python interpreter. |
| 88 | + # Windows has no versioned `python3.11` executable, so pin what `python` resolves to. |
| 89 | + if: "${{ matrix.target.runs-on == 'macos-latest' || matrix.target.os == 'windows' }}" |
84 | 90 | with: |
85 | 91 | python-version: "3.11" |
86 | 92 |
|
|
96 | 102 | --release |
97 | 103 | --manifest-path vortex-python/Cargo.toml |
98 | 104 | --out dist |
99 | | - --interpreter python3.11 |
| 105 | + --interpreter ${{ (matrix.target.os == 'windows' && 'python') || 'python3.11' }} |
100 | 106 | env: |
101 | 107 | MATURIN_PEP517_USE_BASE_PYTHON: "true" |
102 | 108 | # Keep this constant to avoid pyo3 invalidating itself |
@@ -131,6 +137,44 @@ jobs: |
131 | 137 | retention-days: 7 |
132 | 138 | if-no-files-found: error |
133 | 139 |
|
| 140 | + prepare-java-windows: |
| 141 | + runs-on: >- |
| 142 | + ${{ github.repository == 'vortex-data/vortex' |
| 143 | + && format('runs-on={0}/pool=windows-x64-pre/extras=s3-cache', github.run_id) |
| 144 | + || 'windows-latest' }} |
| 145 | + timeout-minutes: 90 |
| 146 | + steps: |
| 147 | + - uses: runs-on/action@v2 |
| 148 | + if: github.repository == 'vortex-data/vortex' |
| 149 | + with: |
| 150 | + sccache: s3 |
| 151 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 152 | + with: |
| 153 | + fetch-depth: 0 |
| 154 | + - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 |
| 155 | + with: |
| 156 | + distribution: "corretto" |
| 157 | + java-version: "17" |
| 158 | + - name: Setup (Windows) |
| 159 | + run: | |
| 160 | + echo "C:\rust\cargo\bin" >> $env:GITHUB_PATH |
| 161 | + - uses: ./.github/actions/setup-prebuild |
| 162 | + with: |
| 163 | + enable-sccache: ${{ github.repository == 'vortex-data/vortex' && 'true' || 'false' }} |
| 164 | + - run: cargo build --release --package vortex-jni |
| 165 | + shell: bash |
| 166 | + # Cargo names the Windows cdylib `vortex_jni.dll`; the bundled resource keeps the |
| 167 | + # `lib` prefix used on every other platform so NativeLoader builds a single name. |
| 168 | + - name: Rename JNI library |
| 169 | + shell: bash |
| 170 | + run: cp target/release/vortex_jni.dll target/release/libvortex_jni.dll |
| 171 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 |
| 172 | + with: |
| 173 | + name: "libvortex_jni_x86_64-pc-windows-msvc.zip" |
| 174 | + path: "target/release/libvortex_jni.dll" |
| 175 | + retention-days: 7 |
| 176 | + if-no-files-found: error |
| 177 | + |
134 | 178 | prepare-java-linux: |
135 | 179 | timeout-minutes: 30 |
136 | 180 | strategy: |
@@ -171,7 +215,7 @@ jobs: |
171 | 215 | if-no-files-found: error |
172 | 216 |
|
173 | 217 | prepare-all: |
174 | | - needs: [prepare-python, prepare-java-macos, prepare-java-linux] |
| 218 | + needs: [prepare-python, prepare-java-macos, prepare-java-linux, prepare-java-windows] |
175 | 219 | runs-on: ubuntu-latest |
176 | 220 | timeout-minutes: 10 |
177 | 221 | steps: |
|
0 commit comments