-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
40 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,39 +12,44 @@ env: | |
|
||
jobs: | ||
create-release-executables: | ||
runs-on: ${{ matrix.config.os }} | ||
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 -D 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-12 # 13 and 14 run on M1 chips, and we get a linker error when using them | ||
cmake_configure_args: -D CMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -D CMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/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 | ||
- { | ||
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-12, # 13 and 14 run on M1 chips, and we get a linker error when using them | ||
cmake_configure_args: -D CMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -D CMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/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 | ||
- 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 | ||
- 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/[email protected] | ||
|
||
|
@@ -65,37 +70,24 @@ jobs: | |
- name: ccache | ||
uses: hendrikmuhs/ccache-action@main | ||
with: | ||
key: ${{ matrix.config.name }} Clang-Release | ||
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 }} | ||
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 | ||
buildDirectory: ${{github.workspace}}/build | ||
|
||
- name: Create installer | ||
run: | | ||
cd ${{ github.workspace }}/build | ||
cd ${{github.workspace}}/build | ||
cpack | ||
- name: Zip bin/Release | ||
if: runner.os != 'Windows' | ||
run: | | ||
cd ${{ github.workspace }}/bin/Release | ||
zip -r ${{ github.workspace }}/Release.zip . | ||
- name: Zip bin/Release (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
powershell Compress-Archive -Path bin/Release -DestinationPath Release.zip | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
build/${{ matrix.config.installer_name }} | ||
Release.zip | ||
files: ${{runner.os != 'Windows' && github.workspace || ''}}${{runner.os != 'Windows' && '/' || ''}}build/${{matrix.config.installer_name}} |