Skip to content

Commit 927f979

Browse files
committed
[HSTACK] Enable build action run
1 parent 3be6774 commit 927f979

File tree

1 file changed

+103
-83
lines changed

1 file changed

+103
-83
lines changed

.github/workflows/build.yml

Lines changed: 103 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717

1818
name: Python Release Build
1919
on:
20-
pull_request:
21-
branches: ["main"]
20+
workflow_dispatch: {}
2221
push:
23-
tags: ["*-rc*"]
24-
branches: ["branch-*"]
22+
branches: ["main*"]
2523

2624
jobs:
2725
build:
@@ -43,28 +41,27 @@ jobs:
4341
run: uv sync --dev --no-install-package datafusion
4442

4543
# Update output format to enable automatic inline annotations.
46-
- name: Run Ruff
47-
run: |
48-
uv run --no-project ruff check --output-format=github python/
49-
uv run --no-project ruff format --check python/
44+
# - name: Run Ruff
45+
# run: |
46+
# uv run --no-project ruff check --output-format=github python/
47+
# uv run --no-project ruff format --check python/
5048

51-
generate-license:
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v4
55-
- uses: astral-sh/setup-uv@v5
56-
with:
57-
enable-cache: true
58-
59-
- name: Generate license file
60-
run: uv run --no-project python ./dev/create_license.py
61-
- uses: actions/upload-artifact@v4
62-
with:
63-
name: python-wheel-license
64-
path: LICENSE.txt
49+
# generate-license:
50+
# runs-on: ubuntu-latest
51+
# steps:
52+
# - uses: actions/checkout@v4
53+
# - uses: astral-sh/setup-uv@v5
54+
# with:
55+
# enable-cache: true
56+
#
57+
# - name: Generate license file
58+
# run: uv run --no-project python ./dev/create_license.py
59+
# - uses: actions/upload-artifact@v4
60+
# with:
61+
# name: python-wheel-license
62+
# path: LICENSE.txt
6563

6664
build-python-mac-win:
67-
needs: [generate-license]
6865
name: Mac/Win
6966
runs-on: ${{ matrix.os }}
7067
strategy:
@@ -81,13 +78,6 @@ jobs:
8178

8279
- uses: dtolnay/rust-toolchain@stable
8380

84-
- run: rm LICENSE.txt
85-
- name: Download LICENSE.txt
86-
uses: actions/download-artifact@v4
87-
with:
88-
name: python-wheel-license
89-
path: .
90-
9181
- name: Install Protoc
9282
uses: arduino/setup-protoc@v3
9383
with:
@@ -121,7 +111,6 @@ jobs:
121111
path: target/wheels/*
122112

123113
build-macos-x86_64:
124-
needs: [generate-license]
125114
name: Mac x86_64
126115
runs-on: macos-13
127116
strategy:
@@ -137,13 +126,6 @@ jobs:
137126

138127
- uses: dtolnay/rust-toolchain@stable
139128

140-
- run: rm LICENSE.txt
141-
- name: Download LICENSE.txt
142-
uses: actions/download-artifact@v4
143-
with:
144-
name: python-wheel-license
145-
path: .
146-
147129
- name: Install Protoc
148130
uses: arduino/setup-protoc@v3
149131
with:
@@ -169,26 +151,37 @@ jobs:
169151
path: target/wheels/*
170152

171153
build-manylinux-x86_64:
172-
needs: [generate-license]
173154
name: Manylinux x86_64
174155
runs-on: ubuntu-latest
175156
steps:
176157
- uses: actions/checkout@v4
177-
- run: rm LICENSE.txt
178-
- name: Download LICENSE.txt
179-
uses: actions/download-artifact@v4
158+
- uses: awalsh128/cache-apt-pkgs-action@latest
180159
with:
181-
name: python-wheel-license
182-
path: .
160+
packages: libssl3 openssl
161+
version: 1.0
183162
- run: cat LICENSE.txt
184163
- name: Build wheels
185164
uses: PyO3/maturin-action@v1
186165
env:
187166
RUST_BACKTRACE: 1
188167
with:
189-
rust-toolchain: nightly
168+
rust-toolchain: stable
190169
target: x86_64
191170
manylinux: auto
171+
before-script-linux: |
172+
# If we're running on rhel centos, install needed packages.
173+
if command -v yum &> /dev/null; then
174+
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
175+
176+
# If we're running on i686 we need to symlink libatomic
177+
# in order to build openssl with -latomic flag.
178+
if [[ ! -d "/usr/lib64" ]]; then
179+
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
180+
fi
181+
else
182+
# If we're running on debian-based system.
183+
apt update -y && apt-get install -y libssl-dev openssl pkg-config
184+
fi
192185
rustup-components: rust-std rustfmt # Keep them in one line due to https://github.com/PyO3/maturin-action/issues/153
193186
args: --release --manylinux 2014 --features protoc,substrait
194187
- name: Archive wheels
@@ -198,27 +191,43 @@ jobs:
198191
path: target/wheels/*
199192

200193
build-manylinux-aarch64:
201-
needs: [generate-license]
202194
name: Manylinux arm64
203195
runs-on: ubuntu-latest
204196
steps:
205197
- uses: actions/checkout@v4
206-
- run: rm LICENSE.txt
207-
- name: Download LICENSE.txt
208-
uses: actions/download-artifact@v4
198+
- uses: awalsh128/cache-apt-pkgs-action@latest
209199
with:
210-
name: python-wheel-license
211-
path: .
200+
packages: libssl3 openssl
201+
version: 1.0
212202
- run: cat LICENSE.txt
203+
- name: Setup QEMU
204+
uses: docker/setup-qemu-action@v1
213205
- name: Build wheels
214206
uses: PyO3/maturin-action@v1
215207
env:
216-
RUST_BACKTRACE: 1
208+
RUST_BACKTRACE: full
217209
with:
218-
rust-toolchain: nightly
210+
rust-toolchain: stable
219211
target: aarch64
220212
# Use manylinux_2_28-cross because the manylinux2014-cross has GCC 4.8.5, which causes the build to fail
221213
manylinux: 2_28
214+
container: "ghcr.io/rust-cross/manylinux_2_28-cross:aarch64"
215+
docker-options: "--platform linux/arm64 -e CFLAGS=\"-I/usr/include\" -e LDFLAGS=\"-L/usr/lib\" -e CFLAGS_aarch64_unknown_linux_gnu=\"-I/usr/include\""
216+
before-script-linux: |
217+
# If we're running on rhel centos, install needed packages.
218+
if command -v yum &> /dev/null; then
219+
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
220+
221+
# If we're running on i686 we need to symlink libatomic
222+
# in order to build openssl with -latomic flag.
223+
if [[ ! -d "/usr/lib64" ]]; then
224+
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
225+
fi
226+
else
227+
# If we're running on debian-based system.
228+
apt update -y && apt-get install -y libssl-dev openssl pkg-config librust-openssl-sys-dev
229+
fi
230+
ls -lA /usr/include/openssl/
222231
rustup-components: rust-std rustfmt # Keep them in one line due to https://github.com/PyO3/maturin-action/issues/153
223232
args: --release --features protoc,substrait
224233
- name: Archive wheels
@@ -227,35 +236,46 @@ jobs:
227236
name: dist-manylinux-aarch64
228237
path: target/wheels/*
229238

230-
build-sdist:
231-
needs: [generate-license]
232-
name: Source distribution
233-
runs-on: ubuntu-latest
234-
steps:
235-
- uses: actions/checkout@v4
236-
- run: rm LICENSE.txt
237-
- name: Download LICENSE.txt
238-
uses: actions/download-artifact@v4
239-
with:
240-
name: python-wheel-license
241-
path: .
242-
- run: cat LICENSE.txt
243-
- name: Build sdist
244-
uses: PyO3/maturin-action@v1
245-
with:
246-
rust-toolchain: stable
247-
manylinux: auto
248-
rustup-components: rust-std rustfmt
249-
args: --release --sdist --out dist --features protoc,substrait
250-
- name: Assert sdist build does not generate wheels
251-
run: |
252-
if [ "$(ls -A target/wheels)" ]; then
253-
echo "Error: Sdist build generated wheels"
254-
exit 1
255-
else
256-
echo "Directory is clean"
257-
fi
258-
shell: bash
239+
# build-sdist:
240+
# name: Source distribution
241+
# runs-on: ubuntu-latest
242+
# steps:
243+
# - uses: actions/checkout@v4
244+
# - uses: awalsh128/cache-apt-pkgs-action@latest
245+
# with:
246+
# packages: libssl3 openssl
247+
# version: 1.0
248+
# - run: cat LICENSE.txt
249+
# - name: Build sdist
250+
# uses: PyO3/maturin-action@v1
251+
# with:
252+
# rust-toolchain: stable
253+
# manylinux: auto
254+
# before-script-linux: |
255+
# # If we're running on rhel centos, install needed packages.
256+
# if command -v yum &> /dev/null; then
257+
# yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
258+
#
259+
# # If we're running on i686 we need to symlink libatomic
260+
# # in order to build openssl with -latomic flag.
261+
# if [[ ! -d "/usr/lib64" ]]; then
262+
# ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
263+
# fi
264+
# else
265+
# # If we're running on debian-based system.
266+
# apt update -y && apt-get install -y libssl-dev openssl pkg-config
267+
# fi
268+
# rustup-components: rust-std rustfmt
269+
# args: --release --sdist --out dist --features protoc,substrait
270+
# - name: Assert sdist build does not generate wheels
271+
# run: |
272+
# if [ "$(ls -A target/wheels)" ]; then
273+
# echo "Error: Sdist build generated wheels"
274+
# exit 1
275+
# else
276+
# echo "Directory is clean"
277+
# fi
278+
# shell: bash
259279

260280
merge-build-artifacts:
261281
runs-on: ubuntu-latest
@@ -264,7 +284,7 @@ jobs:
264284
- build-macos-x86_64
265285
- build-manylinux-x86_64
266286
- build-manylinux-aarch64
267-
- build-sdist
287+
# - build-sdist
268288
steps:
269289
- name: Merge Build Artifacts
270290
uses: actions/upload-artifact/merge@v4

0 commit comments

Comments
 (0)