Skip to content

Commit 62b9ef9

Browse files
Create Build_wheels_for_cpython34_x86_64.yml
1 parent 9f06566 commit 62b9ef9

File tree

1 file changed

+232
-0
lines changed

1 file changed

+232
-0
lines changed
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
name: Build wheels w/o cibw for CPython3.4 x86_64
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 amd64 CPython 3.4
18+
runs-on: ubuntu-latest
19+
matrix: linux
20+
arch: i386
21+
tag_arch: x86_64
22+
release: xenial
23+
mirror: http://azure.archive.ubuntu.com/ubuntu
24+
version: 1.5.6.3
25+
pyver: "3.4"
26+
getpipurl: https://bootstrap.pypa.io/pip/2.7/get-pip.py
27+
pypkg: python3.4
28+
pyengine_tag: cp34-cp34m
29+
libc_tag: manylinux_2_17
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
with:
34+
submodules: 'recursive'
35+
36+
- name: Update and upgrade Ubuntu 24
37+
if: matrix.os.matrix == 'linux'
38+
run: |
39+
sudo which apt
40+
sudo apt update;
41+
sudo apt purge -y firefox lxd snapd;
42+
sudo apt install -y zram-config;
43+
sudo apt list --upgradable;
44+
sudo apt upgrade -y;
45+
sudo apt install -f
46+
47+
- name: Build source distribution with Ubuntu
48+
if: matrix.os.matrix == 'linux'
49+
run: |
50+
sudo apt install -y devscripts debootstrap qemu-user;
51+
pip install build;
52+
python -m build --sdist --outdir dist .
53+
54+
- name: Debootstrap Ubuntu ${{matrix.os.release}} ${{matrix.os.arch}}
55+
if: matrix.os.matrix == 'linux'
56+
run: |
57+
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
58+
59+
- name: Update and Upgrade Ubuntu ${{matrix.os.release}}
60+
if: matrix.os.matrix == 'linux'
61+
run: |
62+
sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel
63+
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/proc -t proc
64+
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/dev/pts -t devpts
65+
sudo mount none ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/sys -t sysfs
66+
echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-${{matrix.os.release}} main" > rusoft-python.list
67+
echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-${{matrix.os.release}} main" > rusoft-backports.list
68+
echo " deb [trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-${{matrix.os.release}} main" > rusoft-packages.list
69+
echo " deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu ${{matrix.os.release}} main" > deadsnakes.list
70+
sudo find ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} -iname apt
71+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update
72+
sudo cp -v ./*.list ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/etc/apt/sources.list.d
73+
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
74+
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'
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-old.gpg -Orusoft-old.gpg'
76+
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'
77+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt update
78+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y
79+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt -fy install
80+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt upgrade -y
81+
82+
83+
- name: Pepare dev files
84+
if: matrix.os.matrix == 'linux'
85+
run: |
86+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y libzstd-dev
87+
88+
- name: Pepare for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
89+
if: matrix.os.matrix == 'linux'
90+
run: |
91+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /usr/bin/apt install -y ${{matrix.os.pypkg}}-dev gcc pkg-config ${{matrix.os.pypkgadd}}
92+
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"
93+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} /bin/bash -c "${{matrix.os.pypkg}} -m pip install -U 'setuptools<72.0'"
94+
95+
- name: Pepare source and build wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
96+
if: matrix.os.matrix == 'linux'
97+
run: |
98+
sudo mkdir -p ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/
99+
sudo tar -xvf dist/zstd-${{matrix.os.version}}.tar.gz -C ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/
100+
false && sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} env
101+
sudo chroot ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}} pkg-config libzstd --modversion
102+
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"
103+
104+
- name: Test wheel for ${{matrix.os.pypkg}} ${{matrix.os.arch}}
105+
if: matrix.os.matrix == 'linux'
106+
run: |
107+
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"
108+
109+
- name: Pepare wheel for upload
110+
if: matrix.os.matrix == 'linux'
111+
run: |
112+
sudo cp -v ./ubuntu-${{matrix.os.release}}-${{matrix.os.arch}}/build_wheel/zstd-${{matrix.os.version}}/dist/* ./dist
113+
sudo ls -lh ./dist/*
114+
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"
115+
sudo rm -vf ./dist/*.tar.gz
116+
117+
- name: Build ${{ matrix.os.name }} wheels and test (old)
118+
uses: pypa/cibuildwheel@v1.12.0
119+
if: matrix.cibw.group == 'old'
120+
with:
121+
output-dir: dist
122+
env:
123+
CIBW_BUILD: ${{ matrix.cibw.build }}
124+
# Skip 32-bit builds // NO
125+
# CIBW_SKIP: '*-win32 *_i686'
126+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
127+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
128+
CIBW_MUSLLINUX_I686_IMAGE: musllinux_1_2
129+
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
130+
# Only build on x86 and arm64 for linux
131+
CIBW_ARCHS_LINUX: i686 x86_64
132+
CIBW_BEFORE_ALL_LINUX: >
133+
python -m pip install --upgrade pip
134+
# CIBW_ARCHS_MACOS: x86_64 arm64 universal2
135+
# Building two wheels for MacOS and skipping Universal
136+
CIBW_ARCHS_MACOS: x86_64
137+
# Skip testing Apple Silicon until there are GH runners
138+
CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64'
139+
CIBW_BEFORE_ALL_MACOS: >
140+
python -m pip install --upgrade pip
141+
# CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.7
142+
CIBW_BUILD_VERBOSITY_MACOS: 0
143+
CIBW_BEFORE_ALL_WINDOWS: >
144+
python -m pip install --upgrade pip
145+
CIBW_TEST_COMMAND: >
146+
python -m unittest discover -v -s {package}
147+
148+
- name: Build ${{ matrix.os.name }} wheels and test (new)
149+
uses: joerick/cibuildwheel@v2.22.0
150+
if: matrix.cibw.group == 'new'
151+
with:
152+
output-dir: dist
153+
env:
154+
CIBW_BUILD: ${{ matrix.cibw.build }}
155+
# Skip 32-bit builds // NO
156+
# CIBW_SKIP: '*-win32 *_i686'
157+
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
158+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
159+
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
160+
CIBW_MUSLLINUX_I686_IMAGE: musllinux_1_1
161+
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_1
162+
# Only build on x86 and arm64 for linux
163+
CIBW_ARCHS_LINUX: auto aarch64
164+
CIBW_BEFORE_ALL_LINUX: >
165+
python -m pip install --upgrade pip
166+
# CIBW_ARCHS_MACOS: x86_64 arm64 universal2
167+
# Building two wheels for MacOS and skipping Universal
168+
CIBW_ARCHS_MACOS: x86_64 arm64
169+
# Skip testing Apple Silicon until there are GH runners
170+
CIBW_TEST_SKIP: '*_arm64 *_universal2:arm64'
171+
CIBW_BEFORE_ALL_MACOS: >
172+
python -m pip install --upgrade pip
173+
# CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.7
174+
CIBW_BUILD_VERBOSITY_MACOS: 0
175+
CIBW_BEFORE_ALL_WINDOWS: >
176+
python -m pip install --upgrade pip
177+
CIBW_TEST_COMMAND: >
178+
python -m unittest discover -v -s {package}
179+
180+
# - name: Upload artifacts
181+
# uses: actions/upload-artifact@v4
182+
# with:
183+
# name: wheels
184+
#. path: ./dist
185+
# compression-level: 0
186+
187+
- name: Test for secrets access
188+
id: check_secrets
189+
# If a third party makes a pull request
190+
# this allows automated steps below to be skipped
191+
# and leave a clean PR CI run
192+
shell: bash
193+
run: |
194+
unset HAS_SECRET
195+
unset HAS_SECRET_TEST
196+
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
197+
if [ -n "$SECRET_TEST" ]; then HAS_SECRET_TEST='true' ; fi
198+
echo ::set-output name=HAS_SECRET::${HAS_SECRET}
199+
echo ::set-output name=HAS_SECRET_TEST::${HAS_SECRET_TEST}
200+
env:
201+
SECRET: "${{ secrets.pypi_password }}"
202+
SECRET_TEST: "${{ secrets.test_pypi_password }}"
203+
204+
- name: Install twine
205+
run: pip install twine
206+
207+
- name: Publish distribution to PyPI
208+
if: >
209+
startsWith(github.event.ref, 'refs/tags') &&
210+
steps.check_secrets.outputs.HAS_SECRET
211+
env:
212+
# If the PR/Push has secret access
213+
# and PYPI_PASSWORD is in GH Secrets for this repo
214+
# and this is a tag, publish to PyPI
215+
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
216+
TWINE_USERNAME: "${{ secrets.pypi_username }}"
217+
TWINE_NON_INTERACTIVE: 1
218+
TWINE_PASSWORD: "${{ secrets.pypi_password }}"
219+
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
220+
221+
- name: Publish distribution to Test PyPI
222+
if: steps.check_secrets.outputs.HAS_SECRET
223+
env:
224+
# If the PR/Push has secret access
225+
# and TEST_PYPI_PASSWORD is in GH Secrets for this repo
226+
# then publish each build to test PyPI
227+
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
228+
TWINE_USERNAME: "${{ secrets.test_pypi_username }}"
229+
TWINE_NON_INTERACTIVE: 1
230+
TWINE_PASSWORD: "${{ secrets.test_pypi_password }}"
231+
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
232+

0 commit comments

Comments
 (0)