Update buildexe #48
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 BIN | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-py-to-bin: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v4 | |
- name: Set up Python | |
run: uv python install 3.12 | |
- name: Install requirements | |
run: uv pip install --system -r requirements.txt | |
- name: Run all tests except invalid nexts | |
run: uv run pytest src/test_main.py --deselect src/test_main.py::test_no_invalid_nexts | |
continue-on-error: true | |
# We only want it to fail when there's something that could crash the game | |
- name: Run invalid nexts test | |
run: uv run pytest src/test_main.py::test_no_invalid_nexts | |
- name: Build with PyInstaller | |
run: uv run pyinstaller -F src/main.py --hidden-import sys --add-data src/resources/:./resources/ --name Cave-of-Shadows-AdventureSoft | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Cave-of-Shadows-AdventureSoft-${{ matrix.os }} | |
path: dist/Cave-of-Shadows-AdventureSoft.* | |
publish: | |
needs: build-py-to-bin | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Cave-of-Shadows-AdventureSoft-windows-latest | |
path: windows-artifact | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Cave-of-Shadows-AdventureSoft-ubuntu-latest | |
path: linux-artifact | |
- name: Publish | |
uses: softprops/[email protected] | |
with: | |
files: | | |
windows-artifact/Cave-of-Shadows-AdventureSoft.exe | |
linux-artifact/Cave-of-Shadows-AdventureSoft | |
tag_name: v${{ github.run_number }} | |
prerelease: false | |
name: v${{ github.run_number }} |