Skip to content

Commit

Permalink
create linux and windows executables on github using actions
Browse files Browse the repository at this point in the history
  • Loading branch information
markfinn committed Jan 16, 2024
1 parent 805c7a9 commit 842dfbb
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 5 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Make Release
run-name: ${{ github.actor }} build and publishrelease linux 🚀
on:
release:
types: [published]
jobs:
Create-Release-Linux:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Get Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: Create executable
run: |
#cd ${{ github.workspace }}
python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pip install -r build_requirements.txt
pyinstaller -F guimain.py -n make_metric_gcode
- run: mv dist/make_metric_gcode dist/make_metric_gcode.linux
- name: Add Release artifact
uses: softprops/action-gh-release@v1
with:
files: dist/make_metric_gcode.linux
body: GUI executable built with pyinstaller
- run: echo "🍏 This job's status is ${{ job.status }}."

Create-Release-Windows:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Get Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: pyinstaller-windows
uses: JackMcKew/pyinstaller-action-windows@python3-10-pyinstaller-5-3
with:
path: .
- name: Add Release artifact
uses: softprops/action-gh-release@v1
with:
files: dist/windows/make_metric_gcode.exe
37 changes: 37 additions & 0 deletions make_metric_gcode.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['guimain.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='make_metric_gcode',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
16 changes: 11 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ Comments are currently lost in the output because I'm lazy.


# Install
I'm going to try to make releases that are precompiled, but until then:
Just download and run the releases built on github. https://github.com/Brown-County-FIRST-Robotics/MakeMetricGcode/releases/latest

## If you downloaded the source
```bash
git clone [email protected]:Brown-County-FIRST-Robotics/MakeMetricGcode.git
cd MakeMetricGcode
Expand All @@ -25,23 +26,28 @@ pip install -r requirements.txt
```

# Run
If you have a downloaded release executable just run it

## If you downloaded the source
```bash
python guimain.py
```


# Build
## Using github actions to make a release with windows and linux asssets
create a release in github. A workflow in .github/workflows/release.yml will build the artifacts and stick them on the release
## Linux
```bash
. venv/bin/activate
pip install -r requirements.txt
pip install -r build_requirements.txt
python pyinstaller -F guimain.py -n make_metric_gcode
pyinstaller -F guimain.py -n make_metric_gcode
```


# Todo
- [ ] build linux release
- [ ] build windows release
- [x] build linux release
- [x] build windows release
- [ ] build mac release
- [ ] better GUI style: https://www.reddit.com/r/Python/comments/lps11c/how_to_make_tkinter_look_modern_how_to_use_themes/
- [ ] stop using easygui or fix the extension ordering in file open and save dialog
Expand Down

0 comments on commit 842dfbb

Please sign in to comment.