Make wheels for newest python. #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Garden flower | |
on: [push] | |
jobs: | |
lint_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Lint with pycodestyle | |
run: | | |
python3 -m pip install flake8 | |
python3 -m flake8 . --count --ignore=E125,E126,E127,E128,E402,E741,E731,W503,F401,W504,F841 --show-source --statistics --max-line-length=80 --exclude=__pycache__,.tox,.git/,doc/ | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_BUILD: cp3{8,9,10,11,12}-* | |
CIBW_ARCHS: ${{ matrix.arch }} | |
CIBW_BUILD_VERBOSITY: 3 | |
CIBW_TEST_SKIP: "*macosx*arm64*" | |
CIBW_SKIP: "*musllinux*" | |
strategy: | |
matrix: | |
include: | |
- arch: "arm64 x86_64 universal2" | |
os: macos-latest | |
- arch: aarch64 | |
os: ubuntu-latest | |
- arch: x86_64 | |
os: ubuntu-latest | |
- arch: "x86 AMD64" | |
os: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.x' | |
- name: Make sdist | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
python -m pip install build | |
python -m build --sdist | |
- uses: docker/setup-qemu-action@v3 | |
if: ${{ matrix.arch == 'aarch64' }} | |
name: Set up QEMU | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir dist | |
- name: Upload wheels as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels | |
path: dist | |
- name: Upload to GitHub Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: dist/* | |
windows_test: | |
runs-on: windows-latest | |
env: | |
KIVY_GL_BACKEND: angle_sdl2 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install flower | |
run: python -m pip install -e .[dev,ci] | |
- name: Test with pytest | |
run: | | |
$flower_name=(python -c "print('$GITHUB_REPOSITORY'.split('/')[-1])") | |
python -m pytest --cov=kivy_garden.$flower_name --cov-report term --cov-branch | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
env: | |
KIVY_DOC_INCLUDE: 1 | |
KIVY_DOC: 1 | |
run: python3 -m pip install -e .[dev,ci] | |
- name: Generate docs | |
run: | | |
cd doc | |
make html | |
- name: Upload docs as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: doc/build/html | |
- name: gh-pages upload | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
flower_name=$(python3 -c "print('$GITHUB_REPOSITORY'.split('/')[-1])") | |
cp -r doc/build/html ~/docs_temp | |
git config --global user.email "[email protected]" | |
git config --global user.name "Kivy Developers" | |
git remote rm origin || true | |
git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY.git" | |
git checkout --orphan gh-pages | |
cp -r .git ~/docs_git | |
cd .. | |
rm -rf $flower_name | |
mkdir $flower_name | |
cd $flower_name | |
cp -r ~/docs_git .git | |
cp -r ~/docs_temp/* . | |
touch .nojekyll | |
git add . | |
git commit -a -m "Docs for git-$GITHUB_SHA" | |
git push origin gh-pages -f |