diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9f370e1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build binaries + +on: + pull_request: + branches: + - master + push: + tags: + - "*" + +jobs: + linux-elf: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: sudo apt-get install libsdl2-2.0-0 + - run: python -m pip install pyinstaller + - run: python -m pip install --find-links ${WHEELS} wxPython + env: + WHEELS: https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 + - run: python setup.py clean bundle + - uses: actions/upload-artifact@v2 + with: + name: PythonTurtle + path: ${{ github.workspace }}/dist/PythonTurtle + + macos-app: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: python -m pip install pyinstaller wxPython + - run: python setup.py clean bundle + - run: rm ${{ github.workspace }}/dist/PythonTurtle + - uses: actions/upload-artifact@v2 + with: + name: PythonTurtle.app + path: ${{ github.workspace }}/dist/ + + windows-exe: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: python -m pip install pyinstaller wxPython + - run: python setup.py clean bundle + - uses: actions/upload-artifact@v2 + with: + name: PythonTurtle.exe + path: ${{ github.workspace }}\dist\PythonTurtle.exe diff --git a/.github/workflows/build_linux_elf.yml b/.github/workflows/build_linux_elf.yml deleted file mode 100644 index 541a023..0000000 --- a/.github/workflows/build_linux_elf.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build Linux ELF - -on: - push: - tags: - - "*" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - run: sudo apt-get install libsdl2-2.0-0 - - run: python -m pip install pyinstaller - - run: python setup.py clean bundle - - uses: actions/upload-artifact@v2 - with: - name: PythonTurtle for Linux - path: /home/runner/work/PythonTurtle/PythonTurtle/dist/PythonTurtle diff --git a/.github/workflows/build_windows_exe.yml b/.github/workflows/build_windows_exe.yml deleted file mode 100644 index 31e08b3..0000000 --- a/.github/workflows/build_windows_exe.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Build Windows exe - -on: - push: - tags: - - "*" - -jobs: - build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - run: python -m pip install pyinstaller - - run: python setup.py clean bundle - - uses: actions/upload-artifact@v2 - with: - name: PythonTurtle for Windows - path: D:\a\PythonTurtle\PythonTurtle\dist\PythonTurtle.exe diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6ddebc0..4b207e7 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,9 +2,11 @@ name: Checks on: pull_request: - branches: [master] + branches: + - master push: - branches: [master] + branches: + - master jobs: build: @@ -12,7 +14,9 @@ jobs: strategy: fail-fast: false matrix: - env: [flake8, pylint] + env: + - flake8 + - pylint steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4200cf8..0601295 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,9 +2,11 @@ name: Tests on: pull_request: - branches: [master] + branches: + - master push: - branches: [master] + branches: + - master jobs: build: @@ -12,16 +14,22 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.6, 3.7, 3.8] + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + - '3.6' + - '3.7' + - '3.8' steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies for Ubuntu - run: sudo apt-get install libsdl2-2.0-0 if: matrix.os == 'ubuntu-latest' + run: sudo apt-get install libsdl2-2.0-0 - name: Install prerequisites run: python -m pip install --upgrade setuptools pip wheel tox-gh-actions - name: Run tests diff --git a/setup.py b/setup.py index 1cf655d..9955f00 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def run(): """ Create an application bundle (using PyInstaller) """ - import PyInstaller.__main__ + import PyInstaller.__main__ # pylint: disable=import-outside-toplevel resources_folder = os.path.join('pythonturtle', 'resources') @@ -50,8 +50,8 @@ def include_resources(file_glob): '--name=%s' % package.name, '--onefile', '--windowed', - '--add-binary=%s' % include_resources('*.ic*'), - '--add-binary=%s' % include_resources('*.png'), + '--add-data=%s' % include_resources('*.ic*'), + '--add-data=%s' % include_resources('*.png'), '--add-data=%s' % include_resources('*.txt'), '--icon=%s' % resource_path('icon.ico'), os.path.join('pythonturtle', '__main__.py'), diff --git a/tox.ini b/tox.ini index 55cbb97..1679188 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # - Installing wxPython is non-trivial on GNU/Linux. We need to install wheels from a dedicated repository, # located at https://extras.wxpython.org/wxPython4/extras/linux/. For beackground reading see # https://wiki.wxpython.org/How%20to%20install%20wxPython#Installing_wxPython-Phoenix_using_pip -# - The wheel repository specified via --find-links below matches the build environment on Travis CI. +# - The wheel repository specified via --find-links below matches the build environment on GitHub Actions. # - For local Tox runs adapt the wheel repository URLs to match your local environment. [tox] @@ -25,7 +25,6 @@ commands = [testenv:flake8] description = Static code analysis and code style -basepython = python3.6 deps = flake8 commands = @@ -33,10 +32,8 @@ commands = [testenv:pylint] description = Check for errors and code smells -basepython = python3.6 deps = - astroid<2.2 - pylint<2.4 + pylint pyinstaller commands = {envpython} -m pip install --find-links https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 wxPython