Skip to content

Commit

Permalink
ci: fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
knuxify committed Sep 28, 2024
1 parent b5ff2a9 commit 31cf7d9
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 41 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
on:
push:
branches: [main]
pull_request:

name: Build
Expand All @@ -18,22 +17,40 @@ jobs:

- uses: lukka/get-cmake@latest

- name: Restore from cache and setup vcpkg executable and data files.
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: 'vcpkg.json'

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
# This specifies the location of vcpkg, where it is going to be restored from cache, or create from scratch.
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# The Git commit id of vcpkg to be checked out. This is only needed because we are not using a submodule.
vcpkgGitCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
# The vcpkg.json file, which will be part of cache key computation.
vcpkgJsonGlob: '**vcpkg.json'

- name: Run CMake consuming CMakePreset.json and run vcpkg to build packages
uses: lukka/run-cmake@v10
with:
configurePreset: 'ninja-multi-vcpkg'
configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=Release', '-DVCPKG_TARGET_TRIPLET=x64-windows-static']"
buildPreset: 'ninja-multi-vcpkg'
buildPresetAdditionalArgs: "['--config Release']"

- name: Copy Qt DLLs to the release dir
run: |
windeployqt6 D:\a\mossball\mossball\builds\ninja-multi-vcpkg\Release\mossball.exe --release --no-svg --no-network --no-translations --no-opengl-sw --no-system-d3d-compiler
- name: Push build artifacts
uses: actions/upload-artifact@v4
with:
name: mossball-windows-x86_64
path: |
D:/a/mossball/mossball/builds/ninja-multi-vcpkg/Release
flatpak:
name: 'Linux/Flatpak'
runs-on: ubuntu-latest
Expand All @@ -46,6 +63,6 @@ jobs:
submodules: recursive
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: mossball.flatpak
bundle: mossball-linux.flatpak
manifest-path: linux/com.github.lumiscosity.Mossball.yml
cache-key: flatpak-builder-${{ github.sha }}
143 changes: 111 additions & 32 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,119 @@
{
"version": 8,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "ninja",
"displayName": "Ninja Configure Settings",
"description": "Sets build and install directories",
"binaryDir": "${sourceDir}/builds/${presetName}",
"generator": "Ninja"
},
"configurePresets": [
{
"name": "ninja-multi-vcpkg",
"displayName": "Ninja Multi-Config",
"description": "Configure with vcpkg toolchain and generate Ninja project files for all configurations",
"binaryDir": "${sourceDir}/builds/${presetName}",
"generator": "Ninja Multi-Config",
"toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake"
{
"name": "ninja-toolchain",
"displayName": "Ninja Configure Settings with toolchain",
"description": "Sets build and install directories",
"binaryDir": "${sourceDir}/builds/${presetName}-toolchain",
"generator": "Ninja",
"toolchainFile": "$env{TOOLCHAINFILE}"
},
{
"name": "ninja-multi-vcpkg",
"displayName": "Ninja Multi-Config Configure Settings",
"description": "Configure with vcpkg toolchain",
"binaryDir": "${sourceDir}/builds/${presetName}",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
],
"buildPresets": [
{
"name": "ninja-vcpkg-debug",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build (Debug)",
"description": "Build with Ninja/vcpkg (Debug)",
"configuration": "Debug"
},
}
},
{
"name": "msbuild-vcpkg",
"displayName": "MSBuild (vcpkg toolchain) Configure Settings",
"description": "Configure with VS generators and with vcpkg toolchain",
"binaryDir": "${sourceDir}/builds/${presetName}",
"generator": "Visual Studio 17 2022",
"architecture": {
"strategy": "set",
"value": "x64"
},
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
}
],
"buildPresets": [
{
"name": "ninja",
"configurePreset": "ninja",
"displayName": "Build with Ninja",
"description": "Build with Ninja"
},
{
"name": "ninja-multi-vcpkg",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build ninja-multi-vcpkg",
"description": "Build ninja-multi-vcpkg Configurations"
},
{
"name": "ninja-toolchain",
"configurePreset": "ninja-toolchain",
"displayName": "Build ninja-toolchain",
"description": "Build ninja with a toolchain"
},
{
"name": "msbuild-vcpkg",
"configurePreset": "msbuild-vcpkg",
"displayName": "Build MSBuild",
"description": "Build with MSBuild (VS)"
}
],
"workflowPresets": [
{
"name": "ninja-workflow",
"steps": [
{
"name": "ninja-vcpkg-release",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build (Release)",
"description": "Build with Ninja/vcpkg (Release)",
"configuration": "Release"
"type": "configure",
"name": "ninja-multi-vcpkg"
},
{
"name": "ninja-vcpkg",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build",
"description": "Build with Ninja/vcpkg"
"type": "build",
"name": "ninja-multi-vcpkg"
}
]
]
}
],
"packagePresets": [
{
"packageName": "default-package-name",
"packageVersion": "0.1",
"name": "default",
"configurePreset": "ninja",
"generators": [
"TGZ"
]
},
{
"packageName": "default-multi-package-name",
"packageVersion": "0.1",
"name": "ninja-multi-vcpkg",
"configurePreset": "ninja-multi-vcpkg",
"generators": [
"TGZ"
],
"configurations": [
"Release"
]
}
]
}
3 changes: 1 addition & 2 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "main",
"version-string": "latest",
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"dependencies": [
"inih",
"expat",
Expand Down

0 comments on commit 31cf7d9

Please sign in to comment.