Skip to content

Make it buildable on Windows with VS, and add windows Github Actions CI with vcpkg #28

Make it buildable on Windows with VS, and add windows Github Actions CI with vcpkg

Make it buildable on Windows with VS, and add windows Github Actions CI with vcpkg #28

name: Build Windows
on:
push:
branches: [ master, feature/github-actions, feature/ci-windows ]
pull_request:
branches: [ master, feature/github-actions, feature/ci-windows ]
release:
types: [published]
jobs:
build:
name: "Build: ${{ matrix.arch }} - ${{ matrix.deps_type }} deps"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x64]
config: [Release,Release-Only] # Release-Only = try to use static deps as much as possible
include:
- arch: x64
arch_name: 64-bit
arch_suffix: "64"
- config: Release
deps_type: shared
- config: Release-Only
deps_type: static
steps:
- name: Checkout Git Repo
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install latest CMake
uses: lukka/get-cmake@4dcd3eb73017c61159eb130746fbca35d78a3d5f # latest as of 2023-08-30
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@3a22746930754ced94ac552915aa816265ef90c1 # latest as of 2023-08-30
with:
vcpkgGitCommitId: 'e21c414460498b0c7c94d815ad6d1a3d313ff28b' # latest as of 2023-08-30
prependedCacheKey: '${{ matrix.deps_type }}Deps'
- name: Create prefix folder
shell: cmd
run: mkdir prefix
- name: Build tilibs
uses: lukka/run-cmake@fbcfe006bc5450def7a319af91733647d985d157 # latest as of 2023-08-30
with:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
configurePreset: '${{ matrix.arch }}-${{ matrix.config }}'
buildPreset: '${{ matrix.arch }}-${{ matrix.config }}'
env:
VCPKG_FORCE_SYSTEM_BINARIES: 1
CMAKE_INSTALL_PREFIX_OVERRIDE: '${{ github.workspace }}/prefix'
- name: Install tilibs
uses: lukka/run-cmake@fbcfe006bc5450def7a319af91733647d985d157 # latest as of 2023-08-30
with:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
buildPreset: '${{ matrix.arch }}-${{ matrix.config }}'
buildPresetAdditionalArgs: "['--target install']"
- name: Prepare install folder for upload
shell: cmd
run: rename prefix tilibs_windows_${{ matrix.deps_type }}Deps_${{ github.sha }}
- name: Upload install folder
uses: actions/upload-artifact@v3
with:
name: tilibs_windows_${{ matrix.deps_type }}Deps_${{ github.sha }}
path: tilibs_windows_${{ matrix.deps_type }}Deps_${{ github.sha }}