Skip to content

Commit eabae06

Browse files
Create Build_wheels_for_cpython312_x86_u16.yml
1 parent 32faea6 commit eabae06

File tree

1 file changed

+176
-0
lines changed

1 file changed

+176
-0
lines changed
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Build wheels for CPython3.12 x86 on Ububntu16
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+16 i386 CPython 3.12
18+
runs-on: ubuntu-latest
19+
matrix: linux
20+
arch: i386
21+
tag_arch: i686
22+
release: xenial
23+
mirror: http://azure.archive.ubuntu.com/ubuntu
24+
version: 1.5.6.3
25+
pyver: "3.12"
26+
getpipurl: https://bootstrap.pypa.io/pip/get-pip.py
27+
pypkg: python3.12
28+
pypkgadd: python3.12-distutils
29+
pyengine_tag: cp312-cp312
30+
libc_tag: manylinux_2_4
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 dist-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 devscripts 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,gnupg,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+
echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list
68+
echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list
69+
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+
false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt dist-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+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U pkginfo"
96+
97+
98+
- name: Pepare source and build wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
99+
if: matrix.os.matrix == 'linux'
100+
run: |
101+
sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/
102+
sudo tar -xvf dist/zstd-${{matrix.os.version}}.tar.gz -C ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/
103+
false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} env
104+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion
105+
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 python${{matrix.os.pyver}} setup.py bdist_wheel clean"
106+
107+
- name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
108+
if: matrix.os.matrix == 'linux'
109+
run: |
110+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} find /build_wheel/
111+
sudo cp -v glibc-check.sh ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/
112+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}}/ ls -lh build/*/zstd.*.so; ldd build/*/zstd.*.so; file build/*/zstd.*.so; bash ./glibc-check.sh build/*/zstd.*.so"
113+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "cd /build_wheel/zstd-${{matrix.os.version}} && python${{matrix.os.pyver}} setup.py test"
114+
115+
- name: Pepare wheel for upload
116+
if: matrix.os.matrix == 'linux'
117+
run: |
118+
sudo cp -v ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/dist/* ./dist
119+
sudo ls -lh ./dist/*
120+
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"
121+
sudo rm -vf ./dist/*.tar.gz
122+
123+
124+
# - name: Upload artifacts
125+
# uses: actions/upload-artifact@v4
126+
# with:
127+
# name: wheels
128+
#. path: ./dist
129+
# compression-level: 0
130+
131+
- name: Test for secrets access
132+
id: check_secrets
133+
# If a third party makes a pull request
134+
# this allows automated steps below to be skipped
135+
# and leave a clean PR CI run
136+
shell: bash
137+
run: |
138+
unset HAS_SECRET
139+
unset HAS_SECRET_TEST
140+
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
141+
if [ -n "$SECRET_TEST" ]; then HAS_SECRET_TEST='true' ; fi
142+
echo ::set-output name=HAS_SECRET::${HAS_SECRET}
143+
echo ::set-output name=HAS_SECRET_TEST::${HAS_SECRET_TEST}
144+
env:
145+
SECRET: "${{ secrets.pypi_password }}"
146+
SECRET_TEST: "${{ secrets.test_pypi_password }}"
147+
148+
- name: Install twine
149+
run: pip install 'twine<=6.0.1'
150+
151+
- name: Publish distribution to PyPI
152+
if: >
153+
startsWith(github.event.ref, 'refs/tags') &&
154+
steps.check_secrets.outputs.HAS_SECRET
155+
env:
156+
# If the PR/Push has secret access
157+
# and PYPI_PASSWORD is in GH Secrets for this repo
158+
# and this is a tag, publish to PyPI
159+
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
160+
TWINE_USERNAME: "${{ secrets.pypi_username }}"
161+
TWINE_NON_INTERACTIVE: 1
162+
TWINE_PASSWORD: "${{ secrets.pypi_password }}"
163+
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
164+
165+
- name: Publish distribution to Test PyPI
166+
if: steps.check_secrets.outputs.HAS_SECRET
167+
env:
168+
# If the PR/Push has secret access
169+
# and TEST_PYPI_PASSWORD is in GH Secrets for this repo
170+
# then publish each build to test PyPI
171+
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
172+
TWINE_USERNAME: "${{ secrets.test_pypi_username }}"
173+
TWINE_NON_INTERACTIVE: 1
174+
TWINE_PASSWORD: "${{ secrets.test_pypi_password }}"
175+
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
176+

0 commit comments

Comments
 (0)