-
Notifications
You must be signed in to change notification settings - Fork 139
144 lines (132 loc) · 4.36 KB
/
package.yml
File metadata and controls
144 lines (132 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Package
concurrency:
group: package-${{ inputs.version }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
version:
description: "Version to set (e.g., 0.1.0)"
required: true
type: string
workflow_call:
inputs:
version:
description: "Version to set (e.g., 0.1.0)"
required: true
type: string
jobs:
prepare-python:
runs-on: ${{ matrix.target.runs-on }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
target:
- { os: macos, runs-on: "macos-latest", target: aarch64-apple-darwin }
- { os: macos, runs-on: "macos-15-intel", target: x86_64-apple-darwin }
- { os: ubuntu, runs-on: "ubuntu-latest", target: aarch64-unknown-linux-gnu }
- { os: ubuntu, runs-on: "ubuntu-latest", target: x86_64-unknown-linux-gnu }
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: ./.github/actions/setup-rust
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
targets: ${{ matrix.target.target }}
enable-sccache: "false"
- name: Install cargo-edit
uses: taiki-e/cache-cargo-install-action@24c4eaa867646941dd8cd6f08c1497ea68d732ba
with:
tool: cargo-edit
- name: Cargo Set Version
run: |
cargo set-version --workspace ${{ inputs.version }}
- name: Set up Python
uses: actions/setup-python@v6
# Latest macOS doesn't allow maturin to install stuff into the global Python interpreter
if: "${{ matrix.target.runs-on == 'macos-latest' }}"
with:
python-version: "3.11"
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
command: build
maturin-version: 1.10.2
target: ${{ matrix.target.target }}
args: >
${{ (matrix.target.os == 'ubuntu' && '--zig') || '' }}
--compatibility manylinux2014
--release
--manifest-path vortex-python/Cargo.toml
--out dist
--interpreter python3.11
env:
MATURIN_PEP517_USE_BASE_PYTHON: "true"
# Keep this constant to avoid pyo3 invalidating itself
PYO3_ENVIRONMENT_SIGNATURE: "cpython3"
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
name: "wheels-${{ matrix.target.target }}.zip"
path: dist/
retention-days: 7
prepare-java-macos:
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-java@v5
with:
distribution: "corretto"
java-version: "17"
- uses: ./.github/actions/setup-rust
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
enable-sccache: "false"
- run: cargo build --release --package vortex-jni
- uses: actions/upload-artifact@v7
with:
name: "libvortex_jni_aarch64-apple-darwin.zip"
path: "target/release/libvortex_jni.dylib"
retention-days: 7
if-no-files-found: error
prepare-java-linux:
runs-on: ${{ matrix.target.runs-on }}
container:
image: "ubuntu:20.04"
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
target:
- { os: ubuntu, runs-on: "ubuntu-24.04-arm", target: aarch64-unknown-linux-gnu }
- { os: ubuntu, runs-on: "ubuntu-24.04", target: x86_64-unknown-linux-gnu }
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: ./.github/actions/prepare-java-linux
- uses: actions/setup-java@v5
with:
distribution: "corretto"
java-version: "17"
- uses: ./.github/actions/setup-rust
with:
targets: ${{ matrix.target.target }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
enable-sccache: "false"
- run: cargo build --release --package vortex-jni
- uses: actions/upload-artifact@v7
with:
name: "libvortex_jni_${{ matrix.target.target }}.zip"
path: "target/release/libvortex_jni.so"
retention-days: 7
if-no-files-found: error
prepare-all:
needs: [prepare-python, prepare-java-macos, prepare-java-linux]
runs-on: ubuntu-latest
steps:
- run: echo "All packages built successfully"