Skip to content

Commit fd12fc9

Browse files
authored
Merge pull request #781 from pangjunrong/feature/linux-aarch64-release
feat: Linux ARM Release CICD for `glibc 2.35`
2 parents 37dd8ed + 83397f3 commit fd12fc9

File tree

1 file changed

+99
-49
lines changed

1 file changed

+99
-49
lines changed

.github/workflows/release.yml

Lines changed: 99 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -69,53 +69,68 @@ jobs:
6969
name: "ubuntu-latest-${{ matrix.python-version[1] }}"
7070
path: connectorx-python/target/wheels/*.whl
7171

72-
# linux-aarch:
73-
# runs-on: ubuntu-latest
74-
# container: ghcr.io/rust-cross/manylinux_2_28-cross:aarch64
75-
# strategy:
76-
# matrix:
77-
# python-version: [[38, "3.8"], [39, "3.9"], [310, "3.10"], [311, "3.11"]]
78-
# steps:
79-
# - uses: actions/checkout@v2
80-
81-
# - name: Set python version
82-
# run: |
83-
# echo "/opt/python/cp${{ matrix.python-version[0] }}-cp${{ matrix.python-version[0] }}/bin" >> $GITHUB_PATH
84-
85-
# - uses: actions-rs/toolchain@v1
86-
# with:
87-
# toolchain: 1.71.1
88-
# components: rustfmt
89-
# target: aarch64-unknown-linux-gnu
90-
# default: true
91-
92-
# - uses: extractions/setup-just@v1
93-
# env:
94-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
96-
# - uses: Gr1N/setup-poetry@v9
97-
98-
# - name: Install tools
99-
# run: |
100-
# yum install -y epel-release
101-
# yum install -y mysql-devel postgresql-devel freetds-devel krb5-libs clang-devel
102-
103-
# - name: Setup project
104-
# run: |
105-
# just bootstrap-python
106-
107-
# - uses: PyO3/maturin-action@v1
108-
# with:
109-
# rust-toolchain: 1.71.1
110-
# command: build
111-
# args: -m connectorx-python/Cargo.toml --target aarch64-unknown-linux-gnu -i python --release --manylinux 2_28 --features integrated-auth-gssapi
112-
# env:
113-
# SQLITE3_STATIC: 1
114-
115-
# - uses: actions/upload-artifact@v3
116-
# with:
117-
# name: "aarch-${{ matrix.python-version[1] }}"
118-
# path: connectorx-python/target/wheels/*.whl
72+
linux-aarch:
73+
runs-on: ubuntu-22.04-arm
74+
strategy:
75+
matrix:
76+
python-version: ["3.10", "3.11", "3.12", "3.13"]
77+
steps:
78+
- name: Checkout Repository
79+
uses: actions/checkout@v4
80+
81+
# Check architecture of the target machine
82+
- name: Check Target Architecture
83+
run: |
84+
echo "Architecture: $(uname -m)"
85+
if [[ $(uname -m) != "aarch64" ]]; then
86+
echo "Error: This workflow requires ARM architecture (aarch64)."
87+
exit 1
88+
fi
89+
90+
- name: Setup Python
91+
uses: actions/setup-python@v5
92+
with:
93+
python-version: ${{ matrix.python-version }}
94+
95+
- name: Setup Rust
96+
uses: actions-rs/toolchain@v1
97+
with:
98+
toolchain: stable
99+
components: rustfmt
100+
target: aarch64-unknown-linux-gnu
101+
default: true
102+
103+
- name: Setup Just
104+
uses: extractions/setup-just@v2
105+
env:
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
108+
- name: Install Tools
109+
run: |
110+
sudo apt-get update -y
111+
sudo apt-get install -y mysql-client libpq-dev freetds-dev krb5-locales clang libkrb5-dev build-essential gcc musl-tools libsasl2-modules-gssapi-mit libgssapi-krb5-2 krb5-user
112+
- name: Setup Poetry
113+
uses: Gr1N/setup-poetry@v9
114+
115+
- name: Setup Project
116+
run: |
117+
just bootstrap-python
118+
python -m pip install --upgrade pip
119+
pip install maturin
120+
121+
- name: Build Wheel (Native)
122+
run: |
123+
maturin build -m connectorx-python/Cargo.toml --target aarch64-unknown-linux-gnu -i python${{ matrix.python-version }} --release
124+
env:
125+
SQLITE3_STATIC: 1
126+
KRB5_INCLUDE_DIR: /usr/include
127+
KRB5_LIB_DIR: /usr/lib/aarch64-linux-gnu
128+
129+
- name: Upload Artifact
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: "linux-arm-${{ matrix.python-version }}"
133+
path: connectorx-python/target/wheels/*.whl
119134

120135
win-and-mac:
121136
runs-on: ${{ matrix.os }}
@@ -238,7 +253,7 @@ jobs:
238253
pip install *.whl
239254
python -c "import connectorx"
240255
241-
verify-arm:
256+
verify-apple-arm:
242257
runs-on: ${{ matrix.os }}
243258
needs: [apple-arm]
244259
strategy:
@@ -260,9 +275,44 @@ jobs:
260275
pip install *.whl
261276
python -c "import connectorx"
262277
278+
verify-linux-arm:
279+
runs-on: ubuntu-22.04-arm
280+
needs: [linux-aarch]
281+
strategy:
282+
matrix:
283+
python-version: ["3.10", "3.11", "3.12", "3.13"]
284+
steps:
285+
- name: Checkout Repository
286+
uses: actions/checkout@v4
287+
288+
# Check architecture of the target machine
289+
- name: Check Target Architecture
290+
run: |
291+
echo "Architecture: $(uname -m)"
292+
if [[ $(uname -m) != "aarch64" ]]; then
293+
echo "Error: This workflow requires ARM architecture (aarch64)."
294+
exit 1
295+
fi
296+
297+
- name: Setup Python
298+
uses: actions/setup-python@v5
299+
with:
300+
python-version: ${{ matrix.python-version }}
301+
302+
- name: Download Artifact
303+
uses: actions/download-artifact@v4
304+
with:
305+
name: "linux-arm-${{ matrix.python-version }}"
306+
307+
- name: Install and Test
308+
run: |
309+
python -m pip install --upgrade pip
310+
pip install *.whl
311+
python -c 'import connectorx'
312+
263313
upload:
264314
runs-on: ubuntu-latest
265-
needs: [verify, verify-arm]
315+
needs: [verify, verify-apple-arm, verify-linux-arm]
266316
steps:
267317
- name: Download all artifacts
268318
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)