Skip to content

Commit 76928b6

Browse files
authored
Build whl files and create release for tags (#2)
1 parent 272715f commit 76928b6

File tree

1 file changed

+136
-0
lines changed

1 file changed

+136
-0
lines changed

Diff for: .github/workflows/gr-python-release.yml

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: GR Python
19+
20+
on:
21+
push:
22+
branches:
23+
- 'main'
24+
- 'maint-*'
25+
- '[0-9]+.[0-9]+.[0-9]+-gr'
26+
tags:
27+
- 'v[0-9]+.[0-9]+.[0-9]+-gr.[0-9]+'
28+
pull_request:
29+
workflow_dispatch:
30+
31+
permissions:
32+
contents: read
33+
34+
jobs:
35+
python:
36+
name: Python ${{ matrix.python_version }}
37+
runs-on: ubuntu-22.04
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
42+
steps:
43+
- name: Checkout Arrow
44+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
45+
with:
46+
fetch-depth: 0
47+
submodules: recursive
48+
path: arrow
49+
- name: Setup Python
50+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
51+
with:
52+
python-version: ${{ matrix.python_version }}
53+
- name: Build Python Wheel
54+
run: |
55+
# Build Python Wheel
56+
echo "::group::Setup C++"
57+
gcc --version
58+
echo "::endgroup::"
59+
60+
echo "::group::Setup env"
61+
pushd arrow
62+
export PARQUET_TEST_DATA="${PWD}/cpp/submodules/parquet-testing/data"
63+
export ARROW_TEST_DATA="${PWD}/testing/data"
64+
popd
65+
echo "::endgroup::"
66+
67+
echo "::group::Install build dependencies"
68+
sudo ./arrow/dev/release/setup-ubuntu.sh
69+
sudo apt-get install build-essential ninja-build cmake python3-dev nvidia-cuda-toolkit
70+
python3 -m venv pyarrow-dev
71+
source ./pyarrow-dev/bin/activate
72+
pip install -r arrow/python/requirements-build.txt
73+
echo "::endgroup::"
74+
75+
echo "::group::Compile C++"
76+
mkdir dist
77+
export ARROW_HOME=$(pwd)/dist
78+
export LD_LIBRARY_PATH=$(pwd)/dist/lib:$LD_LIBRARY_PATH
79+
export CMAKE_PREFIX_PATH=$ARROW_HOME:$CMAKE_PREFIX_PATH
80+
cmake -S arrow/cpp -B arrow/cpp/build \
81+
-DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
82+
-DCMAKE_INSTALL_LIBDIR=lib \
83+
--preset ninja-release-python-maximal
84+
cmake --build arrow/cpp/build --target install
85+
echo "::endgroup::"
86+
87+
echo "::group::Build Wheel"
88+
pip install wheel
89+
pushd arrow/python
90+
export PYARROW_PARALLEL=4
91+
export PYARROW_WITH_AZUREFS=ON
92+
export PYARROW_WITH_FEATHER=ON
93+
export PYARROW_WITH_FLIGHT=ON
94+
export PYARROW_WITH_GCSFS=ON
95+
export PYARROW_WITH_HDFS=ON
96+
export PYARROW_WITH_S3FS=ON
97+
python setup.py build_ext --build-type=release --bundle-arrow-cpp bdist_wheel
98+
popd
99+
echo "::endgroup::"
100+
101+
echo "::group::List files"
102+
ls -lah arrow/python/dist
103+
echo "::endgroup::"
104+
105+
- name: Upload Wheel
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: Wheel Python ${{ matrix.python_version }}
109+
path: arrow/python/dist/pyarrow-*.whl
110+
111+
release:
112+
name: "Release Wheel files"
113+
if: startsWith(github.ref, 'refs/tags/v')
114+
needs: python
115+
runs-on: ubuntu-latest
116+
permissions:
117+
contents: write
118+
steps:
119+
- name: Download Wheel files
120+
uses: actions/download-artifact@v4
121+
with:
122+
path: dist/
123+
- name: Inspect dist/
124+
run: |
125+
find dist/
126+
- name: Create GitHub Release
127+
env:
128+
GH_TOKEN: ${{ github.token }}
129+
run: |
130+
gh release create ${GITHUB_REF_NAME} \
131+
--repo ${GITHUB_REPOSITORY} \
132+
--verify-tag \
133+
--title "${GITHUB_REF_NAME/*\//}" \
134+
--notes "TODO" \
135+
dist/*/pyarrow-*.whl
136+

0 commit comments

Comments
 (0)