-
-
Notifications
You must be signed in to change notification settings - Fork 2
180 lines (158 loc) · 7.59 KB
/
create_release_executables.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
name: Create release executables
on:
push:
tags:
- "*"
env:
cmake_configure_args: -D WARNINGS_AS_ERRORS_FOR_COOLLAB=ON -D COOLLAB_REQUIRE_ALL_FEATURES=ON
cmakelists_folder: "."
cmake_target: Coollab
jobs:
create-release-executables:
name: ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
fail-fast: false
matrix:
config:
- {
name: Windows,
os: windows-latest,
cmake_configure_args: -D CMAKE_C_COMPILER=cl CMAKE_CXX_COMPILER=cl -G Ninja,
}
- {
name: Linux,
os: ubuntu-22.04, # Some distros (like Debian 12) are still using an "old" glibc version (2.36). In order to be compatible with them we stay on this runner, which uses glibc 2.36
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -G Ninja,
}
- {
name: MacOS,
os: macos-latest,
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -G Ninja -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl -D OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include,
}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up MSVC # NOTE: required to find cl.exe when using the Ninja generator. And we need to use Ninja in order for ccache to be able to cache stuff with MSVC.
if: matrix.config.name == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Cache vcpkg
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: |
${{ runner.temp }}/vcpkg
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }}
restore-keys: vcpkg-${{ runner.os }}-
- name: Cache vcpkg installed packages
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: |
${{ runner.temp }}/vcpkg/installed
${{ runner.temp }}/vcpkg/buildtrees
key: vcpkg-packages-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }}
restore-keys: vcpkg-packages-${{ runner.os }}-
- name: Install vcpkg
if: runner.os == 'Windows'
run: |
if not exist "${{ runner.temp }}\vcpkg" (
git clone https://github.com/microsoft/vcpkg.git ${{ runner.temp }}\vcpkg
cd ${{ runner.temp }}\vcpkg
.\bootstrap-vcpkg.bat
)
shell: cmd
- name: Install Windows dependencies
if: runner.os == 'Windows'
run: |
${{ runner.temp }}\vcpkg\vcpkg.exe install openssl:x64-windows
shell: cmd
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev build-essential libgtk-3-dev
sudo apt-get install -y libssl-dev
sudo apt-get install -y libpulse-dev libasound2-dev
sudo apt-get install -y libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev
sudo apt-get install -y libdbus-1-dev
sudo apt-get install -y libjpeg-dev
- name: Install MacOS dependencies
if: runner.os == 'MacOS'
run: |
brew install ffmpeg
- name: ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{matrix.config.name}} Clang-Release # Key name should match the one used in build_and_run_tests.yml so that we can reuse its cache.
- name: Set CMake Toolchain Argument
if: runner.os == 'Windows'
run: echo "CMAKE_TOOLCHAIN_ARG=-D CMAKE_TOOLCHAIN_FILE=${{ runner.temp }}\vcpkg\scripts\buildsystems\vcpkg.cmake" >> $GITHUB_ENV
shell: bash
- name: Build
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: ${{github.workspace}}/${{env.cmakelists_folder}}/CMakeLists.txt
cmakeAppendedArgs: ${{env.cmake_configure_args}} -D CPACK_GENERATOR=${{matrix.config.cpack_generator}} -D CMAKE_BUILD_TYPE=Release ${{matrix.config.cmake_configure_args}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache ${{ env.CMAKE_TOOLCHAIN_ARG }}
buildWithCMakeArgs: --config Release --target ${{env.cmake_target}}
cmakeBuildType: Release
buildDirectory: ${{github.workspace}}/build
- name: Copy licenses (Windows and MacOS)
if: runner.os != 'Linux'
shell: pwsh
run: |
cd ${{github.workspace}}/build
cmake --install . --prefix tmp_install
New-Item -ItemType Directory -Path "${{github.workspace}}/bin/Release/license"
Copy-Item -Path tmp_install/license/* -Destination ${{github.workspace}}/bin/Release/license/ -Recurse
- name: Copy licenses (Linux)
if: runner.os == 'Linux'
shell: pwsh
run: |
cd ${{github.workspace}}/build
cmake --install . --prefix tmp_install
New-Item -ItemType Directory -Path "${{github.workspace}}/app-resources/Coollab.AppDir/usr/share/licenses/coollab"
Copy-Item -Path tmp_install/license/* -Destination ${{github.workspace}}/app-resources/Coollab.AppDir/usr/share/licenses/coollab -Recurse
- name: Zip Release binaries (Windows)
if: runner.os == 'Windows'
# The launcher doesn't need the DLLs because it has them already, and it saves a lot of download time if we don't have to download the DLLs. For convenience we still provide a WithDLLs version, just in case someone wants to download a specific version of Coollab manually.
run: |
Compress-Archive -Path ${{github.workspace}}\bin\Release\* -DestinationPath ${{github.workspace}}\build\Coollab-${{matrix.config.name}}-WithDLLs.zip
Get-ChildItem -Path ${{github.workspace}}\bin\Release\ -Filter "*.dll" -Recurse | Remove-Item -Force
Compress-Archive -Path ${{github.workspace}}\bin\Release\* -DestinationPath ${{github.workspace}}\build\Coollab-${{matrix.config.name}}.zip
- name: Build AppImage (Linux)
if: runner.os == 'Linux'
run: |
cd app-resources
mkdir -p Coollab.AppDir/usr/bin/
cp -r "${{github.workspace}}/bin/Release/"* Coollab.AppDir/usr/bin/
strip Coollab.AppDir/usr/bin/Coollab
chmod +x Coollab.AppDir/AppRun
wget https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage --appdir Coollab.AppDir --output appimage
mv Coollab-x86_64.AppImage Coollab.AppImage
- name: Zip Release binaries (MacOS)
if: runner.os == 'MacOS'
run: |
cd ${{github.workspace}}/bin/Release
zip -r ${{github.workspace}}/build/Coollab-${{matrix.config.name}}.zip .
- name: Release (Windows)
if: runner.os == 'Windows'
uses: softprops/action-gh-release@v1
with:
files: |
build/Coollab-${{matrix.config.name}}.zip
build/Coollab-${{matrix.config.name}}-WithDLLs.zip
- name: Release (Linux)
if: runner.os == 'Linux'
uses: softprops/action-gh-release@v1
with:
files: ${{github.workspace}}/app-resources/Coollab.AppImage
- name: Release (MacOS)
if: runner.os == 'MacOS'
uses: softprops/action-gh-release@v1
with:
files: ${{github.workspace}}/build/Coollab-${{matrix.config.name}}.zip