-
Notifications
You must be signed in to change notification settings - Fork 12
171 lines (137 loc) · 5.12 KB
/
release-python.yml
File metadata and controls
171 lines (137 loc) · 5.12 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Build Python
run-name: "Build Python SDK ${{ github.ref_name }}"
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [x86_64, aarch64]
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Get JFrog OIDC token
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/jfrog-oidc-token.sh"
- name: Configure cargo for JFrog
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/configure-cargo.sh"
- name: Configure pip registry
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/configure-pip.sh"
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.9'
- name: Copy root LICENSE for maturin
run: cp LICENSE python/LICENSE
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
- name: Install cross-compilation tools (aarch64)
if: matrix.target == 'aarch64'
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu
- name: Install maturin
run: pip install maturin==1.8.3
- name: Build wheels (x86_64)
if: matrix.target == 'x86_64'
run: maturin build --release --manifest-path python/rust/Cargo.toml --out dist
- name: Build wheels (aarch64)
if: matrix.target == 'aarch64'
run: maturin build --release --target aarch64-unknown-linux-gnu --manifest-path python/rust/Cargo.toml --out dist
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- name: Upload wheels
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: wheels-linux-${{ matrix.target }}
path: dist
if-no-files-found: error
build-windows:
runs-on:
group: databricks-protected-runner-group
labels: windows-server-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Get JFrog OIDC token
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/jfrog-oidc-token.sh"
- name: Configure cargo for JFrog
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/configure-cargo.sh"
- name: Configure pip registry
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/configure-pip.sh"
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.9'
- name: Copy root LICENSE for maturin
run: cp LICENSE python/LICENSE
shell: bash
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
- name: Install maturin
run: pip install maturin==1.8.3
- name: Build wheels
run: maturin build --release --manifest-path python/rust/Cargo.toml --out dist
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: wheels-windows
path: dist
if-no-files-found: error
sdist:
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Get JFrog OIDC token
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/jfrog-oidc-token.sh"
- name: Configure cargo for JFrog
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/configure-cargo.sh"
- name: Configure pip registry
shell: bash
run: bash "$GITHUB_WORKSPACE/.github/scripts/configure-pip.sh"
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.9'
- name: Copy root LICENSE for maturin
run: cp LICENSE python/LICENSE
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
- name: Install maturin
run: pip install maturin==1.8.3
- name: Build source distribution
run: maturin sdist --manifest-path python/rust/Cargo.toml --out dist
- name: Upload sdist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: wheels-sdist
path: dist
if-no-files-found: error