Skip to content

Build and Release

Build and Release #34

name: Build and Release
on:
release:
types: [created]
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
# Global environment variables
env:
# Force Python to use UTF-8 encoding for console output.
# This prevents "UnicodeEncodeError: 'charmap'..." when printing emojis on Windows.
PYTHONUTF8: 1
strategy:
matrix:
os: [windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# --- WINDOWS BUILD ---
- name: Build Application (Windows)
run: python build_windows.py
- name: Archive Windows Artifact (zip)
run: |
# Use PowerShell to zip the distribution folder
Compress-Archive -Path dist\DungeonMasterTool -DestinationPath DungeonMasterTool-Windows.zip
# --- RELEASE UPLOAD ---
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: DungeonMasterTool-Windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}