-
-
Notifications
You must be signed in to change notification settings - Fork 3
171 lines (139 loc) · 5.55 KB
/
linux.yml
File metadata and controls
171 lines (139 loc) · 5.55 KB
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
name: Build MVL Project for Linux
on:
workflow_call:
workflow_dispatch:
jobs:
build-linux:
runs-on: ubuntu-latest
name: ${{ matrix.name }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
include:
- name: Linux-Mono
cache-name: linux-mono
bin: ./godot/bin/godot.linuxbsd.editor.x86_64.llvm.mono
steps:
- name: Checkout MVL Repository
uses: actions/checkout@v5
with:
path: mvl-repo
- name: 1. Setup Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential gettext llvm mold scons pkg-config libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu1-mesa-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev libwayland-dev
- name: 2.1. Setup .NET8 SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: 2.2. Setup .NET10 SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: 3. Download and Setup Vintage Story Clients
run: |
echo "Setting up Vintage Story environments..."
wget https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_1.21.5.tar.gz
mkdir -p NET8
tar -xzf vs_client_linux-x64_1.21.5.tar.gz -C NET8
echo "VINTAGE_STORY=$(pwd)/NET8/vintagestory" >> $GITHUB_ENV
echo "Vintage Story paths set."
- name: 4.1. Clone Godot & Cache SCons
id: godot-build
run: git clone https://github.com/scgm0/godot.git --branch MVL
- name: 4.2. Restore Godot build cache
uses: ./mvl-repo/.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: 4.3 Compilation Editor
uses: ./mvl-repo/.github/actions/godot-build
with:
scons-flags: >-
linker=mold
module_mono_enabled=yes
use_llvm=yes
accesskit=no
disable_xr=yes
platform: linuxbsd
target: editor
- name: 4.4 Compilation Release
uses: ./mvl-repo/.github/actions/godot-build
with:
scons-flags: >-
linker=mold
lto=full
profile=../mvl-repo/MVL/GodotBuildProfile/custom.py
build_profile=../mvl-repo/MVL/GodotBuildProfile/custom.build
platform: linuxbsd
target: template_release
- name: 4.5. Save Godot build cache
uses: ./mvl-repo/.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: 4.6 Generate C# glue
run: |
${{ matrix.bin }} --headless --generate-mono-glue ./godot/modules/mono/glue
./godot/modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./godot/bin --push-nupkgs-local ./godot/bin/GodotSharp/Tools/nupkgs --godot-platform=linuxbsd
dotnet nuget add source $(pwd)/godot/bin/GodotSharp/Tools/nupkgs
- name: 5.1 Build and Export MVL Project
run: |
echo "Building MVL solution..."
dotnet build mvl-repo/MVL
echo "Importing assets with Godot..."
${{ matrix.bin }} --path mvl-repo/MVL --import --headless
sed -i "s|custom_template/release=.*|custom_template/release=\"$(pwd)/godot/bin/godot.linuxbsd.template_release.x86_64.mono\"|" mvl-repo/MVL/export_presets.cfg
echo "--- Verifying export_presets.cfg ---"
cat mvl-repo/MVL/export_presets.cfg
echo "------------------------------------"
mkdir -p export_build
mkdir -p export_build/linux
${{ matrix.bin }} --path mvl-repo/MVL --headless --export-release "Linux" $(pwd)/export_build/linux/MVL.x86_64
echo "Export finished."
- name: 5.2 Setup AppimageTool
uses: AnimMouse/setup-appimage@v2
with:
filename: appimagetool
url: https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
cache_key: continuous
- name: 5.3 Package as AppImage
run: |
echo "Creating AppImage structure..."
mkdir -p AppDir
cp export_build/linux/MVL.x86_64 AppDir/
cp export_build/linux/MVL.pck AppDir/
cp -r export_build/linux/data_MVL_linuxbsd_x86_64 AppDir/
cat > AppDir/AppRun <<EOF
#!/bin/sh
set -e
this_dir="\$(readlink -f "\$(dirname "\$0")")"
export PATH="\$this_dir":"\$PATH"
export EXECUTABLEFILE="$APPIMAGE"
exec "\$this_dir"/MVL.x86_64 "\$@"
EOF
chmod +x AppDir/AppRun
cat > AppDir/mvl.desktop <<EOF
[Desktop Entry]
Name=MVL
Name[zh_CN]=神麤詭末的复古物语启动器
Exec=MVL
Icon=icon
Type=Application
Comment=一个开源的复古物语启动器
Categories=Game;Utility;
EOF
cp mvl-repo/MVL/Assets/Icon/icon.svg AppDir/icon.svg
echo "Generating AppImage..."
appimagetool AppDir MVL-x86_64.AppImage --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 22
- name: 6.1. Upload AppImage Artifact
uses: actions/upload-artifact@v7
with:
name: mvl-linux-appimage
path: MVL-x86_64.AppImage
- name: 6.2. Upload Raw Artifact
uses: actions/upload-artifact@v7
with:
name: mvl-linux-raw
path: export_build/linux/*