Skip to content

fix docs requirements #171

fix docs requirements

fix docs requirements #171

# Builds on all branches & PRs
# Deploys to PyPi on "release".
name: Build, test and publish
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
name: Build Wheels
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: x86_64
# broken:
#- os: ubuntu-latest
# arch: aarch64
- os: macos-11
arch: x86_64
# broken:
#- os: macos-11
# arch: arm64
- os: windows-2019
arch: x86
- os: windows-2019
arch: AMD64
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Rewrite version for dev if not tag
if: "!startsWith(github.ref, 'refs/tags/')"
shell: bash
run: |
perl -i -pe "s/__version__\s*=\s*'(.*?)(\.rc.*|\.a.*|\.post.*)?'/__version__='\1.dev0+${GITHUB_SHA::8}'/" setup.py
- name: Note version
shell: bash
run: |
echo "PACKAGE_VERSION=$(python3 -- ./setup.py --version)" >> $GITHUB_ENV
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
# desmume build deps
- name: Install MacOS build deps
if: matrix.os == 'macos-11'
run: |
brew install coreutils gcc sdl2 meson glib
- name: "Windows: Set env: AMD64"
if: matrix.os == 'windows-2019' && matrix.arch == 'AMD64'
shell: bash
run: |
echo CIBW_ENVIRONMENT_WINDOWS="FASTBUILD=1" >> $GITHUB_ENV
- name: "Windows: Set env: x64"
if: matrix.os == 'windows-2019' && matrix.arch == 'x86'
shell: bash
run: |
echo CIBW_ENVIRONMENT_WINDOWS="FASTBUILD=1 BUILD_32=1" >> $GITHUB_ENV
- name: Add msbuild to PATH
if: matrix.os == 'windows-2019'
uses: microsoft/setup-msbuild@v1
# end desume build deps
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_SKIP: "*musllinux*"
CIBW_BEFORE_ALL_LINUX: "{package}/build-manylinux.sh"
CIBW_BEFORE_BUILD_WINDOWS: "rm -rf desmume_src/desmume/src/frontend/interface/windows/__bins"
CIBW_ENVIRONMENT_LINUX: 'CXXFLAGS="-DFORCE_AVX512_0=1 -D_POSIX_C_SOURCE=199309L" CFLAGS="-D_POSIX_C_SOURCE=199309L"'
CIBW_ENVIRONMENT_MACOS: "CC=gcc-10 CXX=g++-10"
CIBW_ENVIRONMENT_WINDOWS: "${{ env.CIBW_ENVIRONMENT_WINDOWS }}"
CIBW_ARCHS: ${{ matrix.arch }}
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl
build_mingw:
runs-on: windows-2019
name: Msys Wheel
strategy:
fail-fast: false
matrix:
include: [
{ msystem: MINGW64, arch: x86_64, path: mingw64 },
{ msystem: MINGW32, arch: i686, path: mingw32 }
]
steps:
- name: Install MSys2 and dependencies
uses: msys2/setup-msys2@v2
with:
update: true
msystem: ${{ matrix.msystem }}
install: >-
git
unzip
mingw-w64-${{ matrix.arch }}-curl
mingw-w64-${{ matrix.arch }}-python
mingw-w64-${{ matrix.arch }}-python-pip
mingw-w64-${{ matrix.arch }}-python-pillow
mingw-w64-${{ matrix.arch }}-openssl
mingw-w64-${{ matrix.arch }}-toolchain
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Rewrite version for dev if not tag
if: "!startsWith(github.ref, 'refs/tags/')"
shell: msys2 {0}
run: |
perl -i -pe "s/__version__\s*=\s*'(.*?)(\.rc.*|\.a.*|\.post.*)?'/__version__='\1.dev0+${GITHUB_SHA::8}'/" setup.py
- name: Note version and add VS to path
shell: msys2 {0}
run: |
echo "PACKAGE_VERSION=$(python3 -- ./setup.py --version)" >> $GITHUB_ENV
- name: Upgrade pip
shell: msys2 {0}
run: |
python -m pip install --upgrade pip wheel
- name: Build Python wheels # microsoft/[email protected] doesn't work here
shell: msys2 {0}
run: |
PATH="$PATH:/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin" python setup.py bdist_wheel
env:
BUILD_32: "${{ matrix.arch == 'x86' && '1' || '' }}"
FASTBUILD: "1"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels-msys2-py-${{ matrix.msystem }}
path: dist/*.whl
deploy:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
name: Deploy wheels to PyPI
steps:
- name: Download wheels
uses: actions/download-artifact@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
pip install twine
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload wheels/*.whl