-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (65 loc) · 2.23 KB
/
buildexe.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build BIN
on:
push:
branches:
- main
jobs:
build-py-to-bin:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install 3.12
- name: Setup venv
run: uv venv
- name: Activate venv Windows
if: matrix.os == 'windows-latest'
run: .venv\Scripts\activate
- name: Activate venv Linux
if: matrix.os == 'ubuntu-latest'
run: source .venv/bin/activate
- name: Install requirements
run: uv pip install -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@v4
with:
name: Cave-of-Shadows-AdventureSoft-${{ matrix.os }}
path: dist/Cave-of-Shadows-AdventureSoft*
publish:
needs: build-py-to-bin
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: Cave-of-Shadows-AdventureSoft-windows-latest
path: windows-artifact
- name: Download artifacts
uses: actions/download-artifact@v4
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 }}