Skip to content

Commit

Permalink
try new windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed Nov 20, 2024
1 parent 6decee1 commit 188cbde
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions .github/workflows/build-and-release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,67 +31,67 @@ jobs:
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'

steps:
# Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
# for Binary Caching.
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
# for Binary Caching.
- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: actions/checkout@v4
with:
submodules: true
- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
shell: bash
- uses: actions/checkout@v4
with:
submodules: true
- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
shell: bash

# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest
# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest

# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
# when it is being run afterwards by CMake.
- name: Restore vcpkg
uses: actions/cache@v4
with:
# The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
# built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
path: |
${{ env._VCPKG_ }}
!${{ env._VCPKG_ }}/buildtrees
!${{ env._VCPKG_ }}/packages
!${{ env._VCPKG_ }}/downloads
!${{ env._VCPKG_ }}/installed
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
key: |
${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}
# Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
# when it is being run afterwards by CMake.
- name: Restore vcpkg
uses: actions/cache@v4
with:
# The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
# built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
# The other paths starting with '!' are exclusions: they contain termporary files generated during the build of the installed packages.
path: |
${{ env._VCPKG_ }}
!${{ env._VCPKG_ }}/buildtrees
!${{ env._VCPKG_ }}/packages
!${{ env._VCPKG_ }}/downloads
!${{ env._VCPKG_ }}/installed
# The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
key: |
${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}
# On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly.
# As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK.
- uses: ilammy/msvc-dev-cmd@v1
# On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly.
# As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK.
- uses: ilammy/msvc-dev-cmd@v1

# Configure CMake (Windows)
- name: Configure CMake (Windows)
shell: cmd
run: |
cmake --preset ninja-multi-vcpkg -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Release
# Configure CMake (Windows)
- name: Configure CMake (Windows)
shell: cmd
run: |
cmake --preset ninja-multi-vcpkg -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Release
# 4. Build the project
- name: Build PlatypusGui
run: cmake --preset ninja-vcpkg-release --build build --config Release --target PlatypusGui
# 4. Build the project
- name: Build PlatypusGui
run: cmake --preset ninja-vcpkg-release --build build --config Release --target PlatypusGui

- name: Deploy Qt Dependencies (Windows)
shell: cmd
run: |
set QT_DIR=C:\Qt\5.15.2\msvc2019_64
set PATH=%QT_DIR%\bin;%PATH%
windeployqt.exe --compiler-runtime --dir build\deployment build\PlatypusGui.exe
- name: Deploy Qt Dependencies (Windows)
shell: cmd
run: |
set QT_DIR=C:\Qt\5.15.2\msvc2019_64
set PATH=%QT_DIR%\bin;%PATH%
windeployqt.exe --compiler-runtime --dir build\deployment build\PlatypusGui.exe
# 6. Upload artifacts for release
- name: Upload Release Artifacts
uses: actions/upload-artifact@v3
with:
name: windows-latest-platypus
path: build\deployment\PlatypusGui.exe
# 6. Upload artifacts for release
- name: Upload Release Artifacts
uses: actions/upload-artifact@v3
with:
name: windows-latest-platypus
path: build\deployment\PlatypusGui.exe

0 comments on commit 188cbde

Please sign in to comment.