mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-09-12 14:33:02 -06:00
ci: vcpkg improvements
* Upgrade to 2025.07.25 * Configure vcpkg settings in vcpkg.json, this avoids needing to duplicate the vcpkg hash used in several places, and also avoids needing to set overlay ports/triplets directories from CMake * Add caching workaround so that builds won't take forever every time * Build on windows-2025
This commit is contained in:
18
.github/workflows/build-macos.yml
vendored
18
.github/workflows/build-macos.yml
vendored
@ -10,7 +10,6 @@ on:
|
||||
- master
|
||||
|
||||
env:
|
||||
VCPKG_COMMIT: 2ad004460f5db4d3b66f62f5799ff66c265c4b5d
|
||||
MELONDS_GIT_BRANCH: ${{ github.ref }}
|
||||
MELONDS_GIT_HASH: ${{ github.sha }}
|
||||
MELONDS_BUILD_PROVIDER: GitHub Actions
|
||||
@ -24,6 +23,10 @@ jobs:
|
||||
|
||||
name: ${{ matrix.arch }}
|
||||
runs-on: macos-14
|
||||
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
|
||||
|
||||
steps:
|
||||
- name: Check out sources
|
||||
uses: actions/checkout@v3
|
||||
@ -32,10 +35,16 @@ jobs:
|
||||
brew install autoconf automake autoconf-archive libtool python-setuptools
|
||||
- name: Set up CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
- name: Restore vcpkg cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}/vcpkg_cache
|
||||
key: vcpkg-${{ matrix.arch }}-osx-${{ hashFiles('vcpkg.json') }}
|
||||
restore-keys: vcpkg-${{ matrix.arch }}-osx-
|
||||
- name: Set up vcpkg
|
||||
uses: lukka/run-vcpkg@v11
|
||||
with:
|
||||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
|
||||
vcpkgJsonGlob: vcpkg.json
|
||||
- name: Build
|
||||
uses: lukka/run-cmake@v10
|
||||
with:
|
||||
@ -53,6 +62,11 @@ jobs:
|
||||
name: macOS-${{ matrix.arch }}
|
||||
path: macOS-${{ matrix.arch }}.zip
|
||||
retention-days: 1
|
||||
- name: Save vcpkg cache
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}/vcpkg_cache
|
||||
key: vcpkg-${{ matrix.arch }}-osx-${{ hashFiles('vcpkg.json') }}
|
||||
|
||||
universal-binary:
|
||||
name: Universal binary
|
||||
|
18
.github/workflows/build-windows.yml
vendored
18
.github/workflows/build-windows.yml
vendored
@ -10,7 +10,6 @@ on:
|
||||
- master
|
||||
|
||||
env:
|
||||
VCPKG_COMMIT: 2ad004460f5db4d3b66f62f5799ff66c265c4b5d
|
||||
MELONDS_GIT_BRANCH: ${{ github.ref }}
|
||||
MELONDS_GIT_HASH: ${{ github.sha }}
|
||||
MELONDS_BUILD_PROVIDER: GitHub Actions
|
||||
@ -18,10 +17,12 @@ env:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
runs-on: windows-2025
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
|
||||
steps:
|
||||
- name: Check out sources
|
||||
uses: actions/checkout@v3
|
||||
@ -31,10 +32,16 @@ jobs:
|
||||
msystem: ucrt64
|
||||
update: true
|
||||
pacboy: gcc:p cmake:p ninja:p make:p
|
||||
- name: Restore vcpkg cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}/vcpkg_cache
|
||||
key: vcpkg-x86_64-mingw-${{ hashFiles('vcpkg.json') }}
|
||||
restore-keys: vcpkg-x86_64-mingw-
|
||||
- name: Set up vcpkg
|
||||
uses: lukka/run-vcpkg@v11
|
||||
with:
|
||||
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}
|
||||
vcpkgJsonGlob: vcpkg.json
|
||||
- name: Configure
|
||||
run: cmake --preset=release-mingw-x86_64 -DMELONDS_EMBED_BUILD_INFO=ON
|
||||
- name: Build
|
||||
@ -43,3 +50,8 @@ jobs:
|
||||
with:
|
||||
name: melonDS-windows-x86_64
|
||||
path: .\build\release-mingw-x86_64\melonDS.exe
|
||||
- name: Save vcpkg cache
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}/vcpkg_cache
|
||||
key: vcpkg-x86_64-mingw-${{ hashFiles('vcpkg.json') }}
|
||||
|
@ -9,15 +9,12 @@ if (VCPKG_ROOT STREQUAL "${_DEFAULT_VCPKG_ROOT}")
|
||||
endif()
|
||||
FetchContent_Declare(vcpkg
|
||||
GIT_REPOSITORY "https://github.com/Microsoft/vcpkg.git"
|
||||
GIT_TAG 2ad004460f5db4d3b66f62f5799ff66c265c4b5d
|
||||
GIT_TAG HEAD
|
||||
EXCLUDE_FROM_ALL
|
||||
SOURCE_DIR "${CMAKE_SOURCE_DIR}/vcpkg")
|
||||
FetchContent_MakeAvailable(vcpkg)
|
||||
endif()
|
||||
|
||||
set(VCPKG_OVERLAY_TRIPLETS "${CMAKE_SOURCE_DIR}/cmake/overlay-triplets")
|
||||
set(VCPKG_OVERLAY_PORTS "${CMAKE_SOURCE_DIR}/cmake/overlay-ports/faad2")
|
||||
|
||||
option(USE_RECOMMENDED_TRIPLETS "Use the recommended triplets that are used for official builds" ON)
|
||||
|
||||
# Duplicated here because it needs to be set before project()
|
||||
|
10
vcpkg.json
10
vcpkg.json
@ -1,4 +1,14 @@
|
||||
{
|
||||
"vcpkg-configuration": {
|
||||
"default-registry": {
|
||||
"kind": "git",
|
||||
"repository": "https://github.com/Microsoft/vcpkg",
|
||||
"baseline": "dd3097e305afa53f7b4312371f62058d2e665320",
|
||||
"reference": "dd3097e305afa53f7b4312371f62058d2e665320"
|
||||
},
|
||||
"overlay-ports": [ "./cmake/overlay-ports" ],
|
||||
"overlay-triplets": [ "./cmake/overlay-triplets" ]
|
||||
},
|
||||
"default-features": ["qt6"],
|
||||
"dependencies": [
|
||||
"sdl2",
|
||||
|
Reference in New Issue
Block a user