Skip to content

🔨 [CI] Install OpenSSL in release_installer workflow #15

🔨 [CI] Install OpenSSL in release_installer workflow

🔨 [CI] Install OpenSSL in release_installer workflow #15

name: "Release Installer"
on:
push:
tags:
- "*"
env:
cmake_configure_args: ""
cmakelists_folder: "."
cmake_target: Coollab-Launcher
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-Launcher-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-Launcher-Linux.sh,
}
- {
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,
cpack_generator: Bundle,
installer_name: Coollab-Launcher-MacOS.dmg,
}
steps:
- name: Import signing certificate
if: runner.os == 'MacOS'
env:
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
MACOS_CERT_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_CERT_KEYCHAIN_PASSWORD }}
run: |
echo "$MACOS_CERT_P12" | base64 --decode > macos_cert.p12
security create-keychain -p "$MACOS_CERT_KEYCHAIN_PASSWORD" build.keychain
security import macos_cert.p12 -k build.keychain -P "$MACOS_CERT_PASSWORD" -T /usr/bin/codesign
# security list-keychains -s build.keychain
# security set-keychain-settings -t 3600 -u build.keychain
# security unlock-keychain -p "$MACOS_CERT_KEYCHAIN_PASSWORD" build.keychain
# security find-identity -v -p codesigning build.keychain
- 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/[email protected]
- 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: 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: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libgtk-3-dev
sudo apt-get install -y libssl-dev
- name: Install MacOS dependencies
if: runner.os == 'MacOS'
run: |
brew install openssl
- 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: Sign the application
if: runner.os == 'MacOS'
env:
MACOS_CERT_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_CERT_KEYCHAIN_PASSWORD }}
run: |
security unlock-keychain -p "$MACOS_CERT_KEYCHAIN_PASSWORD" build.keychain
codesign --deep --force --verify --verbose --sign "Jules Fouchy" ${{github.workspace}}/bin/Release/Coollab-Launcher
- name: Create Installer
run: |
cd ${{github.workspace}}/build
cpack
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{runner.os != 'Windows' && github.workspace || ''}}${{runner.os != 'Windows' && '/' || ''}}build/${{matrix.config.installer_name}}