Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build_apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build_apps

on:
pull_request:
branches: [master]
push:
branches: [master]
Comment on lines +4 to +7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is tricky. We would need:

  1. Binaries should be built in PRs, to verify that the build wouldn't fail when the changes are merged into master.
  2. Binaries should be (built again and) released only when we push a version tag. (Example)

What we probably don't want is a new release each time we push or merge something into master.

See also: Related documentation


jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest] # TODO cclauss: Add macos-latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the TODO, please. If needed better create an issue to remind yourself.

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies for Ubuntu
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install libsdl2-2.0-0
Comment on lines +22 to +23

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if shouldn't be necessary. We shouldn't do a matrix build in the first place.

I would suggest to split this file up and run the build for Linux, macOS and Windows separately. Then you need no ifs, because you know which OS this build job runs for.

- name: Install prerequisites
run: |
python -m pip install --upgrade pip
python -m pip install pyinstaller
- name: Build a platform specific app
run: python setup.py clean bundle
- name: Push Linux app to GitHub Releases
if: matrix.os == 'ubuntu-latest'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Use separate files, then not ifs are needed.

uses: actions/upload-artifact@v2
with:
name: PythonTurtle for Linux
path: /home/runner/work/PythonTurtle/PythonTurtle/dist/PythonTurtle
- name: Push Windows .exe to GitHub Releases
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: PythonTurtle for Windows
path: D:\a\PythonTurtle\PythonTurtle\dist\PythonTurtle.exe