⬆ [Cool] File::rename() now returns a bool to indicate success #167
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -D VCPKG_TARGET_TRIPLET=x64-windows-static, | |
} | |
- { | |
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-static | |
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 |