gbe_fork/.github/workflows/msbuild.yml
ota c408cc4808 + add artifact upload steps
+ remvoe VS detection, it relies on vswhere which is used by the scripts anyway

+ separate the deps & build steps
2023-12-18 02:50:05 +02:00

125 lines
3.2 KiB
YAML

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Windows-build
on:
push:
branches: [ "ci_runner" ]
pull_request:
branches: [ "ci_runner" ]
permissions:
contents: read
env:
# Expected format {owner}/{repo}.
DEPS_REPO: 'otavepto/gbe_fork-deps'
THIRD_PARTY_BASE_DIR: 'third-party'
jobs:
deps:
runs-on: windows-latest
steps:
- name: Lookup cache for deps
id: cache-deps-win
uses: actions/cache@v3
with:
key: ${{ runner.os }}-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)
if: steps.cache-deps-win.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
ref: 'deps/win'
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
lfs: true
- name: Clone third-party deps (deps/common)
if: steps.cache-deps-win.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
ref: 'deps/common'
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common"
lfs: true
- name: Clone third-party deps (common/win)
if: steps.cache-deps-win.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
ref: 'common/win'
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
lfs: true
- name: Build deps
if: steps.cache-deps-win.outputs.cache-hit != 'true'
shell: cmd
working-directory: ${{env.GITHUB_WORKSPACE}}
run: build_win_deps.bat
build:
runs-on: windows-latest
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
- name: Clone third-party build helpers (common/win)
uses: actions/checkout@v4
with:
repository: "${{env.DEPS_REPO}}"
ref: 'common/win'
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
lfs: true
- name: Build release mode
shell: cmd
working-directory: ${{env.GITHUB_WORKSPACE}}
run: build_win.bat release
- name: Build debug mode
shell: cmd
working-directory: ${{env.GITHUB_WORKSPACE}}
run: build_win.bat debug
### upload artifacts
- 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