gbe_fork/.github/workflows/build-win.yml

129 lines
3.3 KiB
YAML

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'
DEPS_CACHE_KEY: emu-deps-win
DEPS_CACHE_DIR: build-win-deps
jobs:
dependencies:
runs-on: windows-2022
steps:
- name: Lookup cache for deps
id: emu-deps-cache-step
uses: actions/cache@v3
with:
key: ${{ env.DEPS_CACHE_KEY }}
path: ${{ env.DEPS_CACHE_DIR }}
lookup-only: true
# we need the repo to build the deps since it has the build scripts
- name: Checkout branch
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- name: Clone third-party deps (deps/win)
if: steps.emu-deps-cache-step.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.emu-deps-cache-step.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.emu-deps-cache-step.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.emu-deps-cache-step.outputs.cache-hit != 'true'
shell: cmd
working-directory: ${{ github.workspace }}
run: build_win_deps.bat
build:
needs: [ dependencies ]
runs-on: windows-2022
steps:
- name: Checkout branch
uses: actions/checkout@v4
### deps
- name: Grab cache for deps
id: emu-deps-cache-step
uses: actions/cache@v3
with:
key: ${{ env.DEPS_CACHE_KEY }}
path: ${{ env.DEPS_CACHE_DIR }}
fail-on-cache-miss: true
- 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
### build + upload release
- name: Build release mode
continue-on-error: true
shell: cmd
working-directory: ${{ github.workspace }}
run: build_win.bat release
- name: Upload build (release)
if: success()
uses: actions/upload-artifact@v4
with:
name: "build-win-release-${{ github.sha }}"
path: 'build-win/release/'
if-no-files-found: 'error'
compression-level: 9
retention-days: 1
### build + upload debug
- name: Build debug mode
continue-on-error: true
shell: cmd
working-directory: ${{ github.workspace }}
run: build_win.bat debug
- name: Upload build (debug)
if: success()
uses: actions/upload-artifact@v4
with:
name: "build-win-debug-${{ github.sha }}"
path: 'build-win/debug/'
if-no-files-found: 'error'
compression-level: 9
retention-days: 1