added cows and sheeps #2
Workflow file for this run
This file contains hidden or 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 Executables | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| include: | |
| - os: ubuntu-latest | |
| output_name: MicroCraftGame-Linux | |
| - os: windows-latest | |
| output_name: MicroCraftGame-Windows.exe | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Build with PyInstaller (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| export PYTHONPATH=$PYTHONPATH:$(pwd) | |
| pyinstaller MicroCraftGame.spec | |
| - name: Build with PyInstaller (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| set PYTHONPATH=%PYTHONPATH%;%CD% | |
| pyinstaller MicroCraftGame.spec | |
| shell: cmd | |
| - name: Rename executable (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| move dist\MicroCraftGame.exe dist\${{ matrix.output_name }} | |
| shell: cmd | |
| - name: Rename executable (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| mv dist/MicroCraftGame dist/${{ matrix.output_name }} | |
| chmod +x dist/${{ matrix.output_name }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.output_name }} | |
| path: dist/${{ matrix.output_name }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: dist/${{ matrix.output_name }} | |
| draft: false | |
| prerelease: false | |
| body: | | |
| ## MicroCraft Game ${{ github.ref_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |