-
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (135 loc) · 4.51 KB
/
steam-builds.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Steam build linux and windows
on:
push:
branches:
- main
env:
QT_VERSION: '6.8.2'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Install Qt
id: qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
add-tools-to-path: true
cache: true
modules: 'qtmultimedia'
- name: Generate and Build with CMake
shell: pwsh
run: |
mkdir -p build
cd build
cmake ..
cmake --build . --config Release --parallel
ls
- name: Clean build directory
shell: pwsh
run: |
cd build/release
Get-ChildItem -Exclude Retr0Mine.exe | Remove-Item -Recurse -Force
- name: Copy Steam API DLL
shell: pwsh
run: |
Copy-Item "lib\steam\win64\steam_api64.dll" -Destination "build\release"
- name: Deploy Qt
shell: pwsh
run: |
cd build/release
$qmlDir = "D:\a\Retr0Mine\Retr0Mine\qml"
windeployqt6 `
--skip-plugin-types designer,iconengines,qmllint,generic,networkinformation,help,qmltooling,sqldrivers,tls,qmlls `
--no-opengl-sw `
--no-system-dxc-compiler `
--no-compiler-runtime `
--no-translations `
--no-system-d3d-compiler `
--qmldir $qmlDir `
Retr0Mine.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Retr0Mine_Windows
path: build/release
linux-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
host: 'linux'
cache: true
add-tools-to-path: true
modules: 'qtmultimedia'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libgl1-mesa-dev fuse libfuse2 libwayland-dev qt6-wayland
# Configure FUSE for the current user
sudo modprobe fuse
sudo groupadd fuse || true
sudo usermod -a -G fuse $USER
- name: Generate and Build with CMake
shell: pwsh
run: |
mkdir -p build
cd build
cmake ..
cmake --build . --config Release --parallel
ls
- name: Create AppDir structure
run: |
mkdir -p AppDir/usr/bin
mkdir -p AppDir/usr/lib
mkdir -p AppDir/usr/share/applications
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
mv build/Retr0Mine AppDir/usr/bin/Retr0Mine
#cp lib/steam/linux64/libsteam_api.so AppDir/usr/lib/
# Create .desktop file
cat > AppDir/usr/share/applications/Retr0Mine.desktop << EOF
[Desktop Entry]
Name=Retr0Mine
Exec=Retr0Mine
Icon=Retr0Mine
Type=Application
Categories=Game;
Comment=Minesweeper game
EOF
# Copy application icon
cp resources/icons/icon.png AppDir/usr/share/icons/hicolor/256x256/apps/Retr0Mine.png
- name: Download linuxdeploy and plugins
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
- name: Deploy with linuxdeploy
run: |
export QMAKE=$(which qmake6)
export QML_SOURCES_PATHS=${{ github.workspace }}/qml
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/lib/steam/linux64
export EXTRA_QT_MODULES="multimedia"
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt
- name: Remove unnecessary files in AppDir
run: |
shopt -s extglob
rm -rf AppDir/!(usr)
- name: Clean unnecessary files
run: |
rm -rf AppDir/usr/translations
rm -rf AppDir/usr/plugins/tls
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: Retr0Mine_Linux
path: AppDir/*