+ add artifact upload steps

+ remvoe VS detection, it relies on vswhere which is used by the scripts anyway

+ separate the deps & build steps
This commit is contained in:
ota 2023-12-16 06:08:03 +02:00 committed by otavepto
parent 2e69c038cc
commit c408cc4808

View File

@ -20,24 +20,22 @@ env:
THIRD_PARTY_BASE_DIR: 'third-party' THIRD_PARTY_BASE_DIR: 'third-party'
jobs: jobs:
build: deps:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Checkout branch - name: Lookup cache for deps
uses: actions/checkout@v4
# just to be sure Visual Studio is available
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.3.1
### deps
- name: Check cache for deps
id: cache-deps-win id: cache-deps-win
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
key: ${{ runner.os }}-deps key: ${{ runner.os }}-deps
path: build-win-deps path: build-win-deps
lookup-only: true
# we need the repo to build the deps since it has the build scripts
- name: Checkout branch
if: steps.cache-deps-win.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Clone third-party deps (deps/win) - name: Clone third-party deps (deps/win)
if: steps.cache-deps-win.outputs.cache-hit != 'true' if: steps.cache-deps-win.outputs.cache-hit != 'true'
@ -72,11 +70,22 @@ jobs:
working-directory: ${{env.GITHUB_WORKSPACE}} working-directory: ${{env.GITHUB_WORKSPACE}}
run: build_win_deps.bat run: build_win_deps.bat
- name: Clean third-party deps
if: steps.cache-deps-win.outputs.cache-hit != 'true' build:
shell: cmd runs-on: windows-latest
working-directory: ${{env.GITHUB_WORKSPACE}}
run: rmdir /s /q third-party & exit /b 0 steps:
- name: Checkout branch
uses: actions/checkout@v4
### deps
- name: Grab cache for deps
id: cache-deps-win
uses: actions/cache@v3
with:
key: ${{ runner.os }}-deps
path: build-win-deps
fail-on-cache-miss: true
### build ### build
- name: Clone third-party build helpers (common/win) - name: Clone third-party build helpers (common/win)
@ -97,5 +106,20 @@ jobs:
working-directory: ${{env.GITHUB_WORKSPACE}} working-directory: ${{env.GITHUB_WORKSPACE}}
run: build_win.bat debug run: build_win.bat debug
### upload artifact ### upload artifacts
#- name: Upload - name: Upload build (release)
uses: actions/upload-artifact@v4
with:
name: 'build-win-release'
path: 'build-win/release/'
if-no-files-found: 'error'
compression-level: 9
- name: Upload build (debug)
uses: actions/upload-artifact@v4
with:
name: 'build-win-debug'
path: 'build-win/debug/'
if-no-files-found: 'error'
compression-level: 9