-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Package Knut on Windows as a zip file
--------- Co-authored-by: Loren Burkholder <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ab3b540
commit 05fd9fd
Showing
1 changed file
with
87 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
name: package knut | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: | ||
- knut tests | ||
types: | ||
- completed | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | ||
cancel-in-progress: true | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
name: ${{ matrix.name }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: Windows | ||
os: windows-latest | ||
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache | ||
cmake_preset: ci | ||
|
||
env: | ||
SCCACHE_CACHE_SIZE: "2G" | ||
|
||
steps: | ||
- name: Inspect Environment Variables | ||
run: env | ||
|
||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Checkout submodules | ||
run: | | ||
git submodule update --init --force --depth=1 --recursive -- 3rdparty/* | ||
- name: Install ninja-build tool | ||
uses: aseprite/get-ninja@main | ||
|
||
- name: Install Qt 6 | ||
uses: jurplel/install-qt-action@v4 | ||
with: | ||
version: 6.5.* # 6.5 is the current LTS (as of 2024-06-06) | ||
cache: true | ||
|
||
- name: Make sure MSVC is found when Ninja generator is in use | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
# Restore the compiler cache from the testing build | ||
- name: "Restore Compiler Cache" | ||
id: compiler-cache-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ matrix.compiler_cache_path }} | ||
key: ${{ matrix.os }}_${{ matrix.cmake_preset }}_compiler_cache | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Configure project | ||
run: cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache --preset=${{ matrix.cmake_preset }} | ||
|
||
- name: Build Project | ||
run: cmake --build --preset=${{ matrix.cmake_preset }} | ||
|
||
- name: Create package | ||
run: | | ||
mkdir deploy | ||
cp build-${{ matrix.cmake_preset }}/bin/knut.exe deploy | ||
windeployqt --release --dir deploy deploy/knut.exe | ||
- name: Output the package as an artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: knut-${{ matrix.os }}-${{ github.sha }} | ||
path: deploy/* | ||
overwrite: true |