feat(): add build.yml
Some checks failed
Build Python Executable / build (push) Failing after 33s

This commit is contained in:
Rim 2025-02-28 16:43:24 -05:00
parent 79d4dbb68e
commit 468046f2fc
3 changed files with 50 additions and 4 deletions

View File

@ -0,0 +1,44 @@
name: Build Python Executable
on:
push:
branches:
- main
schedule:
# - cron: "0 0 * * 0" # Runs weekly on Sunday at midnight UTC
- cron: "*/1 * * * *" # Runs every 1 minute
jobs:
build:
runs-on: ubuntu-latest # Matches the label you assigned to your Gitea runner
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Python 3.9.13
uses: actions/setup-python@v4
with:
python-version: "3.9.13"
- name: Create virtual environment
run: |
python3.9 -m venv venv
python --version
- name: Install dependencies
run: |
source venv/bin/activate
python --version
pip install aiohttp
pip install zope.interface
pip install pip wheel build ./deps/cod_api-2.0.2-py3-none-any.whl
pip install pyinstaller==6.0.0
pip uninstall enum34 -y
python build.py
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: built-executable
path: dist/

View File

@ -21,7 +21,10 @@ if not os.path.exists(replacements_json):
sys.exit(1) sys.exit(1)
# Activate the virtual environment # Activate the virtual environment
venv_activation_script = os.path.join(os.getcwd(), 'venv', 'Scripts', 'activate') if sys.platform == 'win32':
venv_activation_script = os.path.join(os.getcwd(), 'venv', 'bin', 'activate')
else:
venv_activation_script = os.path.join(os.getcwd(), 'venv', 'bin', 'activate')
subprocess.call(venv_activation_script, shell=True) subprocess.call(venv_activation_script, shell=True)
# Run PyInstaller # Run PyInstaller
@ -34,8 +37,8 @@ PyInstaller.__main__.run([
'--icon', ICON, '--icon', ICON,
'--distpath', DIST_PATH, '--distpath', DIST_PATH,
# This is the correct way to add the data file - preserve the directory structure # This is the correct way to add the data file - preserve the directory structure
'--add-data', f"{charset_normalizer_data};charset_normalizer/assets", '--add-data=', f"{charset_normalizer_data};charset_normalizer/assets",
'--add-data', f"{replacements_json};data" # Note: using 'data' as the destination folder '--add-data=', f"{replacements_json};data" # Note: using 'data' as the destination folder
]) ])
# Clean up the build directory and spec file # Clean up the build directory and spec file

View File

@ -44,7 +44,6 @@
"mp_village2": "Hovec Sawmill", "mp_village2": "Hovec Sawmill",
"mp_hardhat": "Hardhat", "mp_hardhat": "Hardhat",
"mp_m_wallco2": "Aisle 9", "mp_m_wallco2": "Aisle 9",
"mp_donetsk": "Verdansk",
"mp_scrapyard": "Zhokov Scrapyard", "mp_scrapyard": "Zhokov Scrapyard",
"mp_m_trench": "Trench", "mp_m_trench": "Trench",
"mp_promenade_gw": "Barakett Promenade", "mp_promenade_gw": "Barakett Promenade",