Skip to content

Commit

Permalink
Merge GUI (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeevan <[email protected]>
Co-authored-by: Valentina <[email protected]>
  • Loading branch information
3 people authored May 31, 2022
2 parents 478fcb7 + ed76df1 commit 58cbd2a
Show file tree
Hide file tree
Showing 9 changed files with 1,216 additions and 338 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Based on https://data-dive.com/multi-os-deployment-in-cloud-using-pyinstaller-and-github-actions

name: Build

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:

createrelease:
name: Create Release
runs-on: [ubuntu-latest]
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt

buildapp:
name: Build App
needs: createrelease
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
TARGET: linux
CMD_DEPEND: >
sudo apt-get update && sudo apt-get install --no-install-recommends -y python3 python3-dev python3-pip python3-opengl python3-wxgtk4.0 freeglut3-dev &&
pip install pyinstaller
CMD_BUILD: >
pyinstaller -F -n logsim --add-data "src/logicgate.png:." src/logsim.py
OUT_FILE_NAME: logsim
ASSET_MIME: application/x-executable
- os: macos-latest
TARGET: macos
CMD_DEPEND: >
brew update --preinstall && brew install python3 &&
pip install -r requirements.txt
CMD_BUILD: >
pyinstaller -F -w -n logsim --add-data "src/logicgate.png:." src/logsim.py &&
cd dist/ && zip -r9 logsim-macos logsim.app/
OUT_FILE_NAME: logsim.zip
ASSET_MIME: application/zip
# - os: windows-latest
# TARGET: windows
# CMD_DEPEND:
# CMD_BUILD: pyinstaller -F -w -n logsim --add-data "src/logicgate.png:." src/logsim.py
# OUT_FILE_NAME: logsim.exe
# ASSET_MIME: application/vnd.microsoft.portable-executable

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: ${{matrix.CMD_DEPEND}}$
- name: Build with pyinstaller for ${{matrix.TARGET}}
run: ${{matrix.CMD_BUILD}}
- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./dist/${{ matrix.OUT_FILE_NAME }}
asset_name: ${{ matrix.OUT_FILE_NAME }}
asset_content_type: ${{ matrix.ASSET_MIME }}
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
branches: [master]

jobs:
Lint:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -22,7 +23,8 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

Test:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out repository code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
- master

jobs:
build:

builddocs:
name: Build Docs
runs-on: ubuntu-latest

steps:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ venv/
ENV/
env.bak/
venv.bak/
myvirtualenv

# Spyder project settings
.spyderproject
Expand All @@ -130,3 +131,8 @@ dmypy.json

# Pyre type checker
.pyre/

#GUI testing
src/fonts/
src/test.py
PyOpenGL-3.1.6-cp39-cp39-win_amd64.whl
Loading

0 comments on commit 58cbd2a

Please sign in to comment.