[WIP] GUI #241
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: Build Python app | |
on: | |
push: | |
paths: | |
- 'images/icon.ico' | |
- 'images/content_copy.png' | |
- 'library/TextConverter.py' | |
- 'versions/terminal_window.py' | |
- 'versions/cli_args.py' | |
- '.github/workflows/build.yml' | |
- 'requirements.txt' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build app on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["windows-latest", "macos-latest", "ubuntu-latest"] | |
steps: | |
- name: Checkout ref | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.sha }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install requirements | |
run: | | |
pip install -r requirements.txt | |
pip install pyinstaller | |
- name: PyInstaller (Terminal GUI) | |
run: pyinstaller versions/terminal_gui.py --icon=images/icon.ico --name cmd | |
- name: PyInstaller (CLI) | |
run: pyinstaller versions/cli_args.py --icon=images/icon.ico --name cli | |
- name: PyInstaller (GUI) | |
run: pyinstaller versions/gui_gui.py --icon=images/icon.ico --add-data "images/icon.ico:images" --add-data "images/content_copy.png:images" --name gui | |
- name: Include extra files | |
shell: bash | |
run: | | |
touch dist/README.md | |
echo # translator CI build >> dist/README.md | |
cat .github/extra-files/partial-README.md >> dist/README.md | |
echo This was built from ${{ github.repository }} >> dist/README.md | |
echo The SHA-1 hash of the commit that these were built from is ${{ github.sha }} >> dist/README.md | |
mkdir dist/licenses | |
cat .github/extra-files/licenses/google-material-design-icons-license.txt >> dist/licenses/google-material-design-icons-license.txt | |
cat LICENSE >> dist/licenses/translator-code-license.txt | |
- name: Upload Builds | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }} build at ${{ github.sha }} | |
path: build/ | |
- name: Upload Dists | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }} dist at ${{ github.sha }} | |
path: dist/ |