1- # This workflow will install Python dependencies, run tests and lint with a single version of Python
2- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41name : Build Metaminesweeper
52
63on :
1411 branches :
1512 - main
1613 - master
17- tags :
18- - ' *'
1914 workflow_dispatch :
2015
2116jobs :
2217 build :
2318 runs-on : windows-latest
2419
2520 steps :
26- - uses : actions/checkout@v4
27-
28-
29- - name : Install Qt
30- uses : jurplel/install-qt-action@v3
31-
32- - name : transform qrc to py with pyrcc5
33- run : |
34- lrelease src/ui/en_US.ts -qm en_US.qm
35- lrelease src/ui/de_DE.ts -qm de_DE.qm
36- lrelease src/ui/pl_PL.ts -qm pl_PL.qm
37-
38-
39- - name : Set up Python 3.12
40- uses : actions/setup-python@v4
41- with :
42- python-version : ' 3.12'
43-
44- - name : Install Python dependencies
45- run : |
46- python -V
47- python -m pip install --upgrade pip
48- pip install flake8 pyinstaller==6.19.0
49- pip install -r requirements.txt
50-
51-
52- # - name: transform ui to py with pyuic5
53- # run: |
54- # cd uiFiles
55- # pyuic5 -o ui_gameSettings.py ui_gs.ui
56- # pyuic5 -o ui_gameSettingShortcuts.py ui_gs_shortcuts.ui
57- # pyuic5 -o ui_defined_parameter.py ui_defined_parameter.ui
58- # pyuic5 -o ui_mine_num_bar.py ui_mine_num_bar.ui
59- # cd ..
60- # md src/ui
61- # cp uiFiles/ui_gameSettings.py src/ui/ui_gameSettings.py
62- # cp uiFiles/ui_gameSettingShortcuts.py src/ui/ui_gameSettingShortcuts.py
63- # cp uiFiles/ui_defined_parameter.py src/ui/ui_defined_parameter.py
64- # cp uiFiles/ui_mine_num_bar.py src/ui/ui_mine_num_bar.py
65-
66- # - name: transform qrc to py with pyrcc5
67- # run: |
68- # cd src
69- # pyrcc5 src_help_pic.qrc -o src_help_pic_rc.py
70- # cd ..
71-
72-
73- - name : Generate metaminesweeper_checksum.pyd
74- run : |
75- pip install cython
76- cd package_tool
77- python setup.py build_ext --inplace
78- ren *.pyd metaminesweeper_checksum.pyd
79- cd ..
80- move package_tool/metaminesweeper_checksum.pyd src/metaminesweeper_checksum.pyd
81- del src/metaminesweeper_checksum.py
82-
83-
84- - name : Package with PyInstaller
85- run : |
86- # pyinstaller --icon "./src/media/cat.ico" --noconsole --noconfirm --clean --add-data "./src/media/*:./media" --add-data "./src/de_DE.qm:." --add-data "./src/pl_PL.qm:." --add-data "./src/en_US.qm:." --paths src --name metasweeper src/main.py
87- pyinstaller --icon "./src/media/cat.ico" --noconsole --noconfirm --clean --add-data "./src/media/*:./media" --add-data "./de_DE.qm:." --add-data "./pl_PL.qm:." --add-data "./en_US.qm:." --paths src --name metasweeper src/main.py
88-
89-
90-
91- - name : Move media and qm files
92- run : |
93- move dist/metaminesweeper/_internal/media dist/metaminesweeper/media
94- move dist/metaminesweeper/_internal/en_US.qm dist/metaminesweeper/en_US.qm
95- move dist/metaminesweeper/_internal/de_DE.qm dist/metaminesweeper/de_DE.qm
96- move dist/metaminesweeper/_internal/pl_PL.qm dist/metaminesweeper/pl_PL.qm
97-
98- # upload the result package as an artifact
99- - name : Upload artifacts
100- uses : actions/upload-artifact@v4
101- if : success()
102- with :
103- name : Metaminesweeper-snapshot
104- path : dist/
21+ - uses : actions/checkout@v4
22+
23+ - name : Install Qt
24+ uses : jurplel/install-qt-action@v3
25+
26+ - name : Generate translation qm files
27+ run : |
28+ lrelease src/ui/en_US.ts -qm src/en_US.qm
29+ lrelease src/ui/de_DE.ts -qm src/de_DE.qm
30+ lrelease src/ui/pl_PL.ts -qm src/pl_PL.qm
31+
32+ - name : Set up Python 3.12
33+ uses : actions/setup-python@v4
34+ with :
35+ python-version : " 3.12"
36+
37+ - name : Install Python dependencies
38+ run : |
39+ python -V
40+ python -m pip install --upgrade pip
41+ pip install flake8 pyinstaller>=6.19.0 cython
42+ pip install -r requirements.txt
43+
44+ - name : Generate metaminesweeper_checksum.pyd
45+ run : |
46+ cd package_tool
47+ python setup.py build_ext --inplace
48+ ren *.pyd metaminesweeper_checksum.pyd
49+ cd ..
50+ move package_tool\metaminesweeper_checksum.pyd src\metaminesweeper_checksum.pyd
51+ del src\metaminesweeper_checksum.py
52+
53+ - name : Package with PyInstaller
54+ run : |
55+ pyinstaller ^
56+ --icon src/media/cat.ico ^
57+ --noconsole ^
58+ --noconfirm ^
59+ --clean ^
60+ --paths src ^
61+ --name metaminesweeper ^
62+ --add-data "src/media;media" ^
63+ --add-data "src/en_US.qm;." ^
64+ --add-data "src/de_DE.qm;." ^
65+ --add-data "src/pl_PL.qm;." ^
66+ src/main.py
67+
68+ - name : Upload artifacts
69+ uses : actions/upload-artifact@v4
70+ if : success()
71+ with :
72+ name : Metaminesweeper-snapshot
73+ path : dist/
0 commit comments