-
Notifications
You must be signed in to change notification settings - Fork 2
206 lines (175 loc) · 8.05 KB
/
main.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Build and Release Example Installer for Windows and Linux
concurrency:
group: "build-release"
cancel-in-progress: true
on:
push:
branches: [ main ]
paths-ignore:
- '*.md'
jobs:
build-windows:
runs-on: windows-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Modify setup.iss for CODEX
run: |
(Get-Content .\installer\src\setup.iss) -replace '#define OutputName\s+\"setup\"', '#define OutputName "codex"' | Set-Content .\installer\src\setup.iss
shell: pwsh
- name: Compile CODEX with ISCC
run: |
.\tooling\InnoSetupEE\ISCC.exe .\installer\src\setup.iss
- name: Modify setup.iss for PLAZA
run: |
(Get-Content .\installer\src\setup.iss) -replace '#define Style\s+\"CODEX\"', '#define Style "PLAZA"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define GroupName\s+\"CODEX\"', '#define GroupName "PLAZA"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define LogoGroup\s+\"5\"', '#define LogoGroup "7"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define IconGroup\s+\"1\"', '#define IconGroup "2"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define MusicGroup\s+\"1\"', '#define MusicGroup "2"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define OutputName\s+\"codex\"', '#define OutputName "plaza"' |
Set-Content .\installer\src\setup.iss
shell: pwsh
- name: Compile PLAZA with ISCC
run: |
.\tooling\InnoSetupEE\ISCC.exe .\installer\src\setup.iss
- name: Modify setup.iss for RUNE
run: |
(Get-Content .\installer\src\setup.iss) -replace '#define Style\s+\"PLAZA\"', '#define Style "RUNE"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define GroupName\s+\"PLAZA\"', '#define GroupName "RUNE"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define LogoGroup\s+\"7\"', '#define LogoGroup "8"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define IconGroup\s+\"2\"', '#define IconGroup "3"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define MusicGroup\s+\"2\"', '#define MusicGroup "3"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define OutputName\s+\"plaza\"', '#define OutputName "rune"' |
Set-Content .\installer\src\setup.iss
shell: pwsh
- name: Compile RUNE with ISCC
run: |
.\tooling\InnoSetupEE\ISCC.exe .\installer\src\setup.iss
- name: Modify setup.iss for ENDEREX
run: |
(Get-Content .\installer\src\setup.iss) -replace '#define Style\s+\"RUNE\"', '#define Style "Amakrits"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define GroupName\s+\"RUNE\"', '#define GroupName "ENDEREX"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define LogoGroup\s+\"8\"', '#define LogoGroup "9"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define IconGroup\s+\"3\"', '#define IconGroup "4"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define MusicGroup\s+\"3\"', '#define MusicGroup "4"' |
Set-Content .\installer\src\setup.iss
(Get-Content .\installer\src\setup.iss) -replace '#define OutputName\s+\"rune\"', '#define OutputName "enderex"' |
Set-Content .\installer\src\setup.iss
shell: pwsh
- name: Compile ENDEREX with ISCC
run: |
.\tooling\InnoSetupEE\ISCC.exe .\installer\src\setup.iss
- name: Upload Windows Installers
uses: actions/upload-artifact@v3
with:
name: windows-installers
path: ./installer/src/DISTRIBUTABLE/*.exe
build-linux:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Install Wine and necessary dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y wine64 wine32 gcc-multilib libc6-dev-i386 libfuse2 appstream
wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
- name: Compile installers with Wine
run: |
compile_installer() {
local style=$1
local group_name=$2
local logo_group=$3
local icon_group=$4
local music_group=$5
local output_name=$6
sed -i "s/#define Style.*/#define Style \"$style\"/" installer/src/setup.iss
sed -i "s/#define GroupName.*/#define GroupName \"$group_name\"/" installer/src/setup.iss
sed -i "s/#define LogoGroup.*/#define LogoGroup \"$logo_group\"/" installer/src/setup.iss
sed -i "s/#define IconGroup.*/#define IconGroup \"$icon_group\"/" installer/src/setup.iss
sed -i "s/#define MusicGroup.*/#define MusicGroup \"$music_group\"/" installer/src/setup.iss
sed -i "s/#define OutputName.*/#define OutputName \"$output_name\"/" installer/src/setup.iss
wine ./tooling/InnoSetupEE/ISCC.exe ./installer/src/setup.iss
}
compile_installer "CODEX" "CODEX" "5" "1" "1" "codex"
compile_installer "PLAZA" "PLAZA" "7" "2" "2" "plaza"
compile_installer "RUNE" "RUNE" "8" "3" "3" "rune"
compile_installer "Amakrits" "ENDEREX" "9" "4" "4" "enderex"
- name: Create AppImages
run: |
create_appimage() {
local installer_name=$1
mkdir -p AppDir
cp installer/src/DISTRIBUTABLE/$installer_name.exe AppDir/
cat > AppDir/AppRun <<EOL
#!/bin/sh
wine "\${APPDIR}/$installer_name.exe" "\$@"
EOL
chmod +x AppDir/AppRun
# Create a basic .desktop file
cat > AppDir/$installer_name.desktop <<EOL
[Desktop Entry]
Name=$installer_name Installer
Exec=AppRun
Icon=wineglass
Type=Application
Categories=Utility;
EOL
# Use the specified icon
wget -O AppDir/wineglass.png http://test.winehq.org/tests/winehq_snapshot/index_files/winehq_logo_glass.png
# Use ARCH environment variable when calling appimagetool
ARCH=x86_64 ./appimagetool-x86_64.AppImage AppDir ${installer_name}_linux.AppImage
rm -rf AppDir
}
create_appimage codex
create_appimage plaza
create_appimage rune
create_appimage enderex
- name: Upload Linux AppImages
uses: actions/upload-artifact@v3
with:
name: linux-appimages
path: ./*.AppImage
create-release:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Download Windows Artifacts
uses: actions/download-artifact@v3
with:
name: windows-installers
path: windows-installers
- name: Download Linux Artifacts
uses: actions/download-artifact@v3
with:
name: linux-appimages
path: linux-appimages
- name: Create GitHub Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Latest Example Preview"
files: |
windows-installers/*.exe
linux-appimages/*.AppImage