Skip to content

Commit

Permalink
build from gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
EphDoering committed Aug 11, 2024
1 parent 213c66c commit 9a5c675
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 20
fetch-tags: 'true'

- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- run: pip install -r requirements.txt
- name: build
run: python build_main.py
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: launcher
path: dist/launcher.exe
4 changes: 2 additions & 2 deletions build_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"speechd", # cspell:disable-line
]

if sys.base_prefix == sys.prefix: # not in venv
if sys.base_prefix == sys.prefix and "GITHUB_RUN_ID" not in os.environ: # not in venv
venv = Path(".", "venv")

if sys.platform == "win32":
Expand Down Expand Up @@ -44,7 +44,7 @@
print(copy_cmd)
if os.system(copy_cmd):
raise RuntimeError()
cmd = [str(venv_python), __file__]
cmd = f"{venv_python} {__file__}"
os.system(cmd)
raise SystemExit()

Expand Down

0 comments on commit 9a5c675

Please sign in to comment.