-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (100 loc) · 3.85 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
name: Build-Static-Win64-and-Linux-AppImage
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Get latest VCPKG commit
shell: bash
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
export LATEST_COMMIT=$(git rev-parse HEAD)
echo "LATEST_COMMIT=$LATEST_COMMIT" >> $GITHUB_ENV
- name: Update builtin-baseline in vcpkg.json
shell: bash
run: |
jq --arg commit "$LATEST_COMMIT" '. + {"builtin-baseline": $commit}' vcpkg.json > temp.json && mv temp.json vcpkg.json
- name: Install vcpkg
run: |
.\vcpkg\bootstrap-vcpkg.bat
- name: Remove vcpkg.json for classic mode
shell: bash
run: |
if [ -f "vcpkg.json" ]; then
rm "vcpkg.json"
fi
- name: Install Dependencies with vcpkg
run: |
.\vcpkg\vcpkg.exe install sdl2 sdl2-mixer[libflac,libmodplug,mpg123,opusfile] libsamplerate --triplet x64-windows-static-release --overlay-triplets=cmake/triplets
- name: Configure CMake
run: |
cmake -B build_vs_64 -S . -DCMAKE_BUILD_TYPE=Release `
-DENABLE_LTO=ON `
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets" `
-DVCPKG_TARGET_TRIPLET="x64-windows-static-release" `
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake
- name: Build
run: cmake --build build_vs_64 --config Release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cry-dev-win64
path: build_vs_64/src/Release/*.exe
retention-days: 90
build-linux:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake g++ fuse patchelf \
libsdl2-dev libsdl2-mixer-dev \
libsamplerate0-dev libflac-dev libmodplug-dev \
libmpg123-dev libopusfile-dev \
libx11-dev libxext-dev libxrender-dev libxrandr-dev \
libxcb1-dev libxcb-render0-dev libxcb-shape0-dev \
libxcb-xfixes0-dev
- name: Install linuxdeploy and plugin
run: |
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
- name: Build the project
run: |
cmake -B build_linux -S . -DCMAKE_BUILD_TYPE=Release
cmake --build build_linux --config Release
- name: Add desktop file and icon
run: |
mkdir -p appdir/usr/share/applications
cp data/doom.desktop appdir/usr/share/applications/cry.desktop
mkdir -p appdir/usr/share/icons/hicolor/128x128/apps
cp data/doom.png appdir/usr/share/icons/hicolor/128x128/apps/cry.png
- name: Add executable to AppDir
run: |
mkdir -p appdir/usr/bin
cp build_linux/src/cry appdir/usr/bin/
- name: Package as AppImage
run: |
./linuxdeploy-x86_64.AppImage --appdir=appdir --output appimage
- name: Clean up unnecessary files
run: |
rm -f linuxdeploy*.AppImage
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: cry-dev-linux64
path: "**/*.AppImage"
retention-days: 90