Skip to content

Commit a12ec69

Browse files
Create Build_wheels_for_cpython39_x86_64_u24.yml
1 parent 4e47895 commit a12ec69

File tree

1 file changed

+175
-0
lines changed

1 file changed

+175
-0
lines changed
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: Build wheels for CPython3.9 x86_64 on Ubuntu24
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheel - ${{ matrix.os.name }}
12+
runs-on: ${{ matrix.os.runs-on }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os:
17+
- name: Ubuntu 24 amd64 CPython 3.9
18+
runs-on: ubuntu-latest
19+
matrix: linux
20+
arch: amd64
21+
tag_arch: x86_64
22+
release: noble
23+
mirror: http://azure.archive.ubuntu.com/ubuntu
24+
version: 1.5.6.3
25+
# pyver: "3.7"
26+
getpipurl: https://bootstrap.pypa.io/pip/get-pip.py
27+
pypkg: python3.9
28+
pypkgadd: python3.9-distutils
29+
pyengine_tag: cp39-cp39
30+
libc_tag: manylinux_2_34
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
with:
35+
submodules: 'recursive'
36+
37+
- name: Update and upgrade Ubuntu 24
38+
if: matrix.os.matrix == 'linux'
39+
run: |
40+
sudo which apt
41+
sudo apt update;
42+
sudo apt purge -y firefox lxd snapd;
43+
sudo apt install -y zram-config;
44+
sudo apt list --upgradable;
45+
sudo apt upgrade -y;
46+
sudo apt install -f
47+
48+
- name: Build source distribution with Ubuntu
49+
if: matrix.os.matrix == 'linux'
50+
run: |
51+
sudo apt install -y debootstrap qemu-user;
52+
pip install build;
53+
python -m build --sdist --outdir dist .
54+
55+
- name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}}
56+
if: matrix.os.matrix == 'linux'
57+
run: |
58+
sudo debootstrap --no-merged-usr --verbose --include=sudo,wget,curl,ca-certificates --arch=${{matrix.os.arch}} ${{matrix.os.release}} ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} ${{matrix.os.mirror}} || tail ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/debootstrap/debootstrap.log
59+
60+
- name: Update and Upgrade Ubuntu ${{matrix.os.release}}
61+
if: matrix.os.matrix == 'linux'
62+
run: |
63+
sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel
64+
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/proc -t proc
65+
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/dev/pts -t devpts
66+
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/sys -t sysfs
67+
false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list
68+
false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list
69+
false && echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list
70+
echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list
71+
false && sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt
72+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update
73+
sudo cp -v ./*.list ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/sources.list.d
74+
false && sudo rm -fv ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/trusted.gpg.d/* && sudo rm -fv ./ubuntu-xenial-x86/etc/apt/trusted.gpg
75+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public.gpg -Orusoft.gpg'
76+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public-old.gpg -Orusoft-old.gpg'
77+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A2CE4BCCC50209DD || true'
78+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update
79+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y
80+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install
81+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y
82+
83+
84+
- name: Pepare dev files
85+
if: matrix.os.matrix == 'linux'
86+
run: |
87+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev
88+
89+
- name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
90+
if: matrix.os.matrix == 'linux'
91+
run: |
92+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}}
93+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "wget ${{matrix.os.getpipurl}} -O get-pip.py && ${{matrix.os.pypkg}} get-pip.py || true"
94+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'"
95+
96+
- name: Pepare source and build wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
97+
if: matrix.os.matrix == 'linux'
98+
run: |
99+
sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/
100+
sudo tar -xvf dist/zstd-${{matrix.os.version}}.tar.gz -C ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/
101+
false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} env
102+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion
103+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ZSTD_ASM=1 _ZSTD_ASM_BMI2=1 ZSTD_THREADS=1 _ZSTD_EXTERNAL=0 ${{matrix.os.pypkg}} setup.py bdist_wheel"
104+
105+
- name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
106+
if: matrix.os.matrix == 'linux'
107+
run: |
108+
false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/
109+
sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/
110+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/; echo LLH; ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so ; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so"
111+
112+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && ${{matrix.os.pypkg}} setup.py test"
113+
114+
- name: Pepare wheel for upload
115+
if: matrix.os.matrix == 'linux'
116+
run: |
117+
sudo cp -v ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/dist/* ./dist
118+
sudo ls -lh ./dist/*
119+
sudo mv -v ./dist/"zstd-${{matrix.os.version}}-${{matrix.os.pyengine_tag}}-linux_${{matrix.os.tag_arch}}.whl" ./dist/"zstd-${{matrix.os.version}}-${{matrix.os.pyengine_tag}}-${{matrix.os.libc_tag}}_${{matrix.os.tag_arch}}.whl"
120+
sudo rm -vf ./dist/*.tar.gz
121+
122+
123+
# - name: Upload artifacts
124+
# uses: actions/upload-artifact@v4
125+
# with:
126+
# name: wheels
127+
#. path: ./dist
128+
# compression-level: 0
129+
130+
- name: Test for secrets access
131+
id: check_secrets
132+
# If a third party makes a pull request
133+
# this allows automated steps below to be skipped
134+
# and leave a clean PR CI run
135+
shell: bash
136+
run: |
137+
unset HAS_SECRET
138+
unset HAS_SECRET_TEST
139+
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
140+
if [ -n "$SECRET_TEST" ]; then HAS_SECRET_TEST='true' ; fi
141+
echo ::set-output name=HAS_SECRET::${HAS_SECRET}
142+
echo ::set-output name=HAS_SECRET_TEST::${HAS_SECRET_TEST}
143+
env:
144+
SECRET: "${{ secrets.pypi_password }}"
145+
SECRET_TEST: "${{ secrets.test_pypi_password }}"
146+
147+
- name: Install twine
148+
run: pip install 'twine<=6.0.1'
149+
150+
- name: Publish distribution to PyPI
151+
if: >
152+
startsWith(github.event.ref, 'refs/tags') &&
153+
steps.check_secrets.outputs.HAS_SECRET
154+
env:
155+
# If the PR/Push has secret access
156+
# and PYPI_PASSWORD is in GH Secrets for this repo
157+
# and this is a tag, publish to PyPI
158+
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
159+
TWINE_USERNAME: "${{ secrets.pypi_username }}"
160+
TWINE_NON_INTERACTIVE: 1
161+
TWINE_PASSWORD: "${{ secrets.pypi_password }}"
162+
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
163+
164+
- name: Publish distribution to Test PyPI
165+
if: steps.check_secrets.outputs.HAS_SECRET
166+
env:
167+
# If the PR/Push has secret access
168+
# and TEST_PYPI_PASSWORD is in GH Secrets for this repo
169+
# then publish each build to test PyPI
170+
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
171+
TWINE_USERNAME: "${{ secrets.test_pypi_username }}"
172+
TWINE_NON_INTERACTIVE: 1
173+
TWINE_PASSWORD: "${{ secrets.test_pypi_password }}"
174+
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
175+

0 commit comments

Comments
 (0)