AI4Kids Rock Paper Scissors v0.1 #6
Workflow file for this run
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 PyInstaller Executable | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install pyinstaller | |
- name: Build executable | |
run: | | |
pyinstaller pyinstaller_recipe.spec | |
shell: bash # Needed for Windows compatibility | |
- name: Upload Artifact (Windows) | |
if: matrix.os == 'windows-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-binary | |
path: dist/AI4Kids-AI-Rock-Paper-Scissors.exe | |
- name: Upload Artifact (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-binary | |
path: dist/AI4Kids-AI-Rock-Paper-Scissors | |
release: | |
needs: build # Waits for the build job to finish | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Windows binary | |
uses: actions/download-artifact@v4 | |
with: | |
name: windows-binary | |
path: dist/ | |
- name: Download Linux binary | |
uses: actions/download-artifact@v4 | |
with: | |
name: linux-binary | |
path: dist/ | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
dist/AI4Kids-AI-Rock-Paper-Scissors.exe | |
dist/AI4Kids-AI-Rock-Paper-Scissors |