Skip to content

Update debug_build-wheels.yml #65

Update debug_build-wheels.yml

Update debug_build-wheels.yml #65

name: Debug build wheels
on: [push, pull_request]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.sha || '' }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheel - ${{ matrix.os.name }}
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
matrix:
os:
- name: macOS old
runs-on: macos-13 # x86
matrix: macos
- name: macOS Latest
runs-on: macos-latest # arm
matrix: macos
- name: Linux
runs-on: ubuntu-latest
matrix: linux
- name: Windows
runs-on: windows-latest
matrix: windows
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.12'
- name: Prepare python
run: |
python -m pip install --upgrade pip
- name: Set up QEMU
if: matrix.os.matrix == 'linux'
uses: docker/setup-qemu-action@v1
with:
platforms: 'arm64'
- name: Build source distribution with Ubuntu
if: matrix.os.matrix == 'linux'
run: |
sudo which apt
sudo apt update;
sudo apt purge -y firefox snapd;
sudo apt list --upgradable;
sudo apt upgrade -y;
sudo apt install -y devscripts debootstrap qemu-user;
pip install build;
python -m build --sdist --outdir dist .
echo LIST-FILES;
find .
sudo debootstrap --include=sudo,wget --arch=i386 xenial ./ubuntu-xenial-x86 http://azure.archive.ubuntu.com/ubuntu
echo http://mirror.yandex.ru/ubuntu
sudo chroot ./ubuntu-xenial-x86 /bin/mkdir /build_wheel
sudo mount none ./ubuntu-xenial-x86/proc -t proc
sudo mount none ./ubuntu-xenial-x86/sys -t sysfs
sudo tar -xvf dist/zstd-1.5.6.3.tar.gz -C ./ubuntu-xenial-x86/build_wheel/
echo 'deb[trusted=yes] http://packages.rusoft.ru/ppa/rusoft/python ubuntu-xenial main' > rusoft-python.list
echo 'deb[trusted=yes] http://packages.rusoft.ru/ppa/rusoft/backports ubuntu-xenial main' > rusoft-backports.list
echo 'deb[trusted=yes] http://packages.rusoft.ru/ppa/rusoft/packages ubuntu-xenial main'> rusoft-packages.list
find ./ubuntu-xenial-x86/etc/apt
sudo chroot ./ubuntu-xenial-x86 /usr/bin/apt update
false && sudo chroot ./ubuntu-xenial-x86 /usr/bin/apt install -y wget
sudo cp -v ./*.list ./ubuntu-xenial-x86/etc/apt/sources.list.d
sudo rm -fv ./ubuntu-xenial-x86/etc/apt/trusted.gpg.d/* && sudo rm -fv ./ubuntu-xenial-x86/etc/apt/trusted.gpg
sudo chroot ./ubuntu-xenial-x86 /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public.gpg -Orusoft.gpg'
false && wget -q -O- http://packages.rusoft.ru/apt/public.gpg | sudo chroot ./ubuntu-xenial-x86 /bin/bash -c 'apt-key add -'
sudo chroot ./ubuntu-xenial-x86 /bin/bash -c 'cd /etc/apt/trusted.gpg.d && wget http://packages.rusoft.ru/apt/public-old.gpg -Orusoft-old.gpg'
false && wget -q -O- http://packages.rusoft.ru/apt/public-old.gpg | sudo chroot ./ubuntu-xenial-x86 /bin/bash -c 'apt-key add -'
sudo false && chroot ./ubuntu-xenial-x86 /bin/bash -c 'apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A2CE4BCCC50209DD'
sudo chroot ./ubuntu-xenial-x86 /usr/bin/apt update
sudo chroot ./ubuntu-xenial-x86 /usr/bin/apt upgrade -y
sudo chroot ./ubuntu-xenial-x86 /usr/bin/apt install -y libzstd-dev python2.7-dev
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: ./dist
- name: Test for secrets access
id: check_secrets
# If a third party makes a pull request
# this allows automated steps below to be skipped
# and leave a clean PR CI run
shell: bash
run: |
unset HAS_SECRET
unset HAS_SECRET_TEST
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
if [ -n "$SECRET_TEST" ]; then HAS_SECRET_TEST='true' ; fi
echo ::set-output name=HAS_SECRET::${HAS_SECRET}
echo ::set-output name=HAS_SECRET_TEST::${HAS_SECRET_TEST}
env:
SECRET: "${{ secrets.pypi_password }}"
SECRET_TEST: "${{ secrets.test_pypi_password }}"
- name: Install twine
run: pip install twine
- name: Publish distribution to PyPI
if: >
startsWith(github.event.ref, 'refs/tags') &&
steps.check_secrets.outputs.HAS_SECRET
env:
# If the PR/Push has secret access
# and PYPI_PASSWORD is in GH Secrets for this repo
# and this is a tag, publish to PyPI
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
TWINE_USERNAME: "${{ secrets.pypi_username }}"
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: "${{ secrets.pypi_password }}"
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
- name: Publish distribution to Test PyPI
if: steps.check_secrets.outputs.HAS_SECRET
env:
# If the PR/Push has secret access
# and TEST_PYPI_PASSWORD is in GH Secrets for this repo
# then publish each build to test PyPI
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
TWINE_USERNAME: "${{ secrets.test_pypi_username }}"
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: "${{ secrets.test_pypi_password }}"
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'