Updated #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Windows | |
on: | |
push: | |
branches: | |
- Stable | |
paths: | |
- '.github/workflows/**' | |
- 'Assets/**' | |
- 'Src/**' | |
- 'versionfile.txt' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.11' | |
architecture: 'x64' | |
cache: 'pip' | |
- name: Get Shortened Commit SHA | |
id: shorten_commit_sha | |
uses: iendeavor/shorten-commit-sha@v2.0.3 | |
with: | |
length: 7 | |
- name: Create virtual environment | |
run: py -m venv .venv | |
- name: Activate virtual environment | |
run: .venv\Scripts\activate | |
- name: Install dependencies | |
run: pip install --upgrade PySide6-Essentials pyinstaller pillow | |
- name: Build with PyInstaller | |
run: | | |
pyinstaller --noconfirm --onedir --windowed --optimize "2" --icon "Assets/Icons/Raubtier.ico" --name "MetalSlugFontReborn" --clean --version-file "versionfile.txt" --add-data "Assets;Assets/" --add-data "Src/special_characters.py;." --add-data "Src/image_generation.py;." --add-data "Src/themes.py;." --add-data "Src/qt_utils.py;." --add-data "Src/info.py;." --add-data "Docs/SUPPORTED.txt;." "Src/qt-version.py" | |
- name: Move Assets and SUPPORTED.txt | |
run: | | |
mv dist/MetalSlugFontReborn/_internal/Assets dist/MetalSlugFontReborn/ | |
mv dist/MetalSlugFontReborn/_internal/SUPPORTED.txt dist/MetalSlugFontReborn/ | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MetalSlugFontReborn-${{ steps.shorten_commit_sha.outputs.shortened_commit_sha }}-Windows-x64-Qt | |
path: dist/MetalSlugFontReborn | |
compression-level: 9 |