Skip to content

Commit

Permalink
Add mac github action
Browse files Browse the repository at this point in the history
  • Loading branch information
mak448a committed Aug 9, 2024
1 parent b7ba2ac commit 3fbc42c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 15 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build Mac
run-name: Build Mac
# on:
# push:
# tags:
# - "**"
on: [push]
jobs:
Build-Windows:
runs-on: macos-latest
steps:
# Use Python 3.12.4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12.4"
- run: git clone https://github.com/mak448a/QTCord/ --depth=1
- run: cd QTCord/helper_scripts && pip install -r requirements.txt && pip install pyinstaller && python3 package_mac.py
- uses: actions/upload-artifact@v4
with:
name: "QTCord-Mac"
path: "QTCord/src/dist/QTCord"
12 changes: 6 additions & 6 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Build Windows
run-name: Build Windows
on:
push:
tags:
- "**"
# on: [push]
# on:
# push:
# tags:
# - "**"
on: [push]
jobs:
Build-Windows:
runs-on: windows-latest
Expand All @@ -15,7 +15,7 @@ jobs:
with:
python-version: "3.12.4"
- run: git clone https://github.com/mak448a/QTCord/ --depth=1
- run: cd QTCord && pip install -r requirements.txt && pip install pyinstaller && python3 package_windows.py
- run: cd QTCord/helper_scripts && pip install -r requirements.txt && pip install pyinstaller && python3 package_windows.py
- uses: actions/upload-artifact@v4
with:
name: "QTCord-Windows"
Expand Down
12 changes: 12 additions & 0 deletions helper_scripts/package_mac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os


try:
import PyInstaller
if PyInstaller:
print("PyInstaller is good to go!")
except ModuleNotFoundError:
raise Exception("You need pyinstaller installed. Make sure to install a version at least 2 months old as to avoid false positives on virus detectors. Use pip install pyinstaller.")

os.chdir("src")
os.system("pyinstaller ../../main.spec")
10 changes: 1 addition & 9 deletions package_windows.py → helper_scripts/package_windows.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import shutil


try:
Expand All @@ -10,11 +9,4 @@
raise Exception("You need pyinstaller installed. Make sure to install a version at least 2 months old as to avoid false positives on virus detectors. Use pip install pyinstaller.")

os.chdir("src")
os.system("pyinstaller ../main.spec")

# choice = input("Delete build cache? (N/y) ").strip().lower()

# if choice == "yes" or choice == "y":
# shutil.rmtree("build")
# else:
# quit()
os.system("pyinstaller ../../main.spec")

0 comments on commit 3fbc42c

Please sign in to comment.