fix : keep clang on macOS config #150
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, | |
cpack_generator: NSIS, | |
installer_name: Coollab-Windows.exe, | |
} | |
- { | |
name: Linux, | |
os: ubuntu-latest, | |
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -G Ninja, | |
cpack_generator: STGZ, | |
installer_name: Coollab-Linux.sh, | |
} | |
- { | |
name: MacOS, | |
os: macos-latest, # 13 and 14 run on M1 chips, and we get a linker error when using them | |
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, | |
cpack_generator: Bundle, | |
installer_name: Coollab-Mac.dmg, | |
} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8 # Temporary workaround for Linux Clang not working atm. See https://github.com/actions/runner-images/issues/8659 | |
with: | |
os: ${{ matrix.config.os }} | |
- 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: 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 | |
- 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: 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 | |
buildWithCMakeArgs: --config Release --target ${{env.cmake_target}} | |
cmakeBuildType: Release | |
buildDirectory: ${{github.workspace}}/build | |
- name: Create installer | |
run: | | |
cd ${{github.workspace}}/build | |
cpack | |
- name: Zip Release binaries (Linux and MacOS) | |
if: runner.os != 'Windows' | |
run: | | |
cd ${{github.workspace}}/bin/Release | |
zip -r ${{github.workspace}}/build/release-binaries-${{matrix.config.name}}.zip . | |
- name: Zip Release binaries (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
Compress-Archive -Path ${{github.workspace}}\bin\Release\* -DestinationPath ${{github.workspace}}\build\release-binaries-${{matrix.config.name}}.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
${{runner.os != 'Windows' && github.workspace || ''}}${{runner.os != 'Windows' && '/' || ''}}build/${{matrix.config.installer_name}} | |
${{runner.os != 'Windows' && github.workspace || ''}}${{runner.os != 'Windows' && '/' || ''}}build/release-binaries-${{matrix.config.name}}.zip |