Skip to content

chore: Update PyInstaller command in build-and-release.yml to include… #14

chore: Update PyInstaller command in build-and-release.yml to include…

chore: Update PyInstaller command in build-and-release.yml to include… #14

name: Build and Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update
sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf
fi
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
shell: bash
- name: Build with PyInstaller
run: |
python -c "import sys; print(sys.executable)"
python -m PyInstaller --onefile --windowed --add-data "images:images" --add-data "sounds:sounds" --name patience main.py
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: patience-${{ matrix.os }}
path: dist/*
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
patience-ubuntu-latest/*
patience-windows-latest/*
patience-macos-latest/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}