Skip to content

Commit

Permalink
Merge pull request #430 from missionpinball/new-installer
Browse files Browse the repository at this point in the history
New installer
  • Loading branch information
toomanybrians authored Aug 16, 2022
2 parents c151b31 + d04b026 commit b0cf511
Show file tree
Hide file tree
Showing 25 changed files with 396 additions and 1,255 deletions.
200 changes: 200 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# GitHub Workflow to build, test, and upload wheels

# TODO: Implement GitHub's caching to speed up builds
# TODO: Decide on specific versions of dependencies, and our locking strategy
# TODO: Implement ARM-based macOS builds on a self-hosted runner
# TODO: Raspberry Pi builds
# TODO: Linting

name: Wheel Builder

on: [push, pull_request]

jobs:
build_wheels:
name: Build for ${{ matrix.cibw-build }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
python-version: 3.7
cibw-build: cp37-win_amd64
- os: windows-latest
python-version: 3.8
cibw-build: cp38-win_amd64
- os: windows-latest
python-version: 3.9
cibw-build: cp39-win_amd64
- os: ubuntu-latest
python-version: 3.7
cibw-build: cp37-manylinux_x86_64
- os: ubuntu-latest
python-version: 3.8
cibw-build: cp38-manylinux_x86_64
- os: ubuntu-latest
python-version: 3.9
cibw-build: cp39-manylinux_x86_64
# - os: macos-latest # Github hosted and self-hosted ARM runners are not yet available, so I'll just build locally for now.
# python-version: 3.8
# cibw-build: cp38-macosx_arm64
# - os: macos-latest
# python-version: 3.9
# cibw-build: cp39-macosx_arm64
- os: macos-latest
python-version: 3.7
cibw-build: cp37-macosx_x86_64
- os: macos-latest
python-version: 3.8
cibw-build: cp38-macosx_x86_64
- os: macos-latest
python-version: 3.9
cibw-build: cp39-macosx_x86_64

steps:
- name: Checkout MPF-MC
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run cibuildwheel
uses: pypa/cibuildwheel@v2.8.1
env:
CIBW_BEFORE_ALL_LINUX: > # This is done here and not as its own step as this runs inside the cibw containered environment
yum install -y SDL2.x86_64 SDL2-devel.x86_64 SDL2_image.x86_64 SDL2_image-devel.x86_64
SDL2_mixer.x86_64 SDL2_mixer-devel.x86_64 gstreamer1.x86_64 gstreamer1-devel.x86_64 &&
python -m pip install --upgrade pip &&
pip install --upgrade setuptools wheel build &&
git clone --recursive --branch ${{ github.ref_name }} https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch `python get_version.py` https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch dev https://github.com/missionpinball/mpf.git _mpf &&
pip install -e _mpf
CIBW_BEFORE_ALL_MACOS: >
brew install SDL2 SDL2_mixer SDL2_image SDL2_ttf gstreamer
CIBW_BEFORE_ALL: >
python -m pip install --upgrade pip &&
pip install --upgrade setuptools wheel build &&
git clone --recursive --branch ${{ github.ref_name }} https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch `python get_version.py` https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch dev https://github.com/missionpinball/mpf.git _mpf &&
pip install -e _mpf
CIBW_BUILD: ${{ matrix.cibw-build }}
CIBW_BUILD_VERBOSITY: 3
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: mpf-mc_wheels
path: ./wheelhouse/*.whl

make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- name: Check out MPF-MC
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build SDist
run: >
sudo apt-get update &&
sudo apt-get -y install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
gstreamer1.0-plugins-base gstreamer1.0-plugins-base gstreamer1.0-plugins-bad
gstreamer1.0-plugins-ugly libgstreamer1.0-dev &&
pip install --upgrade setuptools wheel build &&
python -m build --sdist
- name: Upload SDist
uses: actions/upload-artifact@v3
with:
name: mpf-mc_wheels
path: dist/*.tar.gz

test_wheels:
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
needs: [build_wheels]
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
python-version: 3.9
run-tests: true
runs-on: ${{ matrix.os }}
env:
DISPLAY: ':99.0'
steps:
- name: Install runtime libraries on macOS
if: runner.os == 'macOS'
run: brew install SDL2 SDL2_mixer gstreamer
- name: Install runtime libraries on Linux
if: runner.os == 'linux'
run: |
sudo apt-get update
sudo apt-get -y install libsdl2-2.0 libsdl2-mixer-2.0 gstreamer-1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly xvfb
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install runtime dependencies via pip
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel coveralls prospector==1.3.1
- name: Download the newly-built wheel
uses: actions/download-artifact@v3
with:
name: mpf-mc_wheels
path: dist
- name: Clone & install MPF # try to find a matching version before we default to dev
run: >
git clone --recursive --branch ${{ github.ref_name }} https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch `python get_version.py` https://github.com/missionpinball/mpf.git _mpf ||
git clone --recursive --branch dev https://github.com/missionpinball/mpf.git _mpf &&
pip install -e _mpf
- name: Install MPF-MC from new wheel
run: pip install --pre --find-links=dist mpf-mc
- name: Run tests # Can't figure out how to run tests on mac or windows, but I guess that's ok? At least we test the wheel installs? TODO?
if: ${{ matrix.run-tests }} # controlled via the matrix:include: section above
run: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1280x720x24 -ac +extension GLX
coverage3 run --concurrency=thread -m unittest discover mpfmc.tests
coverage3 run -a --concurrency=thread -m unittest discover mpfmc.integration
- name: Upload coverage data to coveralls.io
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}-${{ matrix.os }}
COVERALLS_PARALLEL: true

publish_to_pypi: # only if this release has a tag and is a push from us (e.g. not a pull request)
name: Publish to PYPI
needs: [test_wheels, make_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- name: Download wheels
uses: actions/download-artifact@v3
with:
name: mpf-mc_wheels
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

coveralls:
name: Finalize Coveralls
needs: test_wheels
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ build_scripts/wheels

# editor tmp
.*.swp

.vscode
157 changes: 0 additions & 157 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Mission Pinball Framework - Media Controller (mpf-mc)
=====================================================

<img align="right" height="146" src="mpfmc/icons/mpfmc-logo.png"/>
<img align="right" height="146" src="https://missionpinball.org/images/mpfmc-logo.png"/>

This package is for the "Media Controller" for the Mission Pinball Framework (MPF).

Expand All @@ -11,17 +11,16 @@ sound, including the DMD, Color DMD, RGB LED DMD, and/or onscreen or LCD display
to drive a DMD and sound even if you don't have an on-screen LCD window. Don't worry--you can run this headless and/or
in a console-only environment for those cases.)

This package (mpf-mc) is MPF's "in box" media controller which is based on Kivy and Python 3. It leverages OpenGL and the
GPU of the computer it's running on. There's also [another media controller option based on Unity 3D](https://github.com/missionpinball/unity-bcp-server) you can use instead.
This package (mpf-mc) is MPF's "in box" media controller which is based on Kivy and Python. It leverages OpenGL and the
GPU of the computer it's running on. There are other media controller projects (at various levels of completeness) you can use with MPF built on Unity, Godot, Rust, and others.

MPF-MC can run on Windows, OS X, and Linux. It can run on the same machine as the core MPF engine, or it can be a
MPF-MC runs on Windows, Mac, Linux, and Raspberry Pi. It can run on the same machine as the core MPF engine, or it can be a
separate machine. It runs as a separate process from MPF, so it works well on a multi-core computer.

The MPF project homepage is here : http://missionpinball.org

[![Coverage Status](https://coveralls.io/repos/missionpinball/mpf-mc/badge.svg?branch=dev&service=github)](https://coveralls.io/github/missionpinball/mpf-mc?branch=dev)
[![Build Status](https://travis-ci.org/missionpinball/mpf-mc.svg?branch=dev)](https://travis-ci.org/missionpinball/mpf-mc)
[![Code Health](https://landscape.io/github/missionpinball/mpf-mc/dev/landscape.svg?style=flat)](https://landscape.io/github/missionpinball/mpf-mc/dev)
[![Test & Build Status](https://github.com/missionpinball/mpf-mc/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/missionpinball/mpf-mc/actions/workflows/build_wheels.yml)

Installation, Documentation, and Examples
-----------------------------------------
Expand Down
Loading

0 comments on commit b0cf511

Please sign in to comment.