mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-10-23 04:58:16 +08:00
4c89a18dda
+ chmod 777 linux build script before running it & use sudo
121 lines
3.1 KiB
YAML
121 lines
3.1 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'
|
|
|
|
jobs:
|
|
dependencies:
|
|
runs-on: windows-2022
|
|
|
|
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: ${{ 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: cache-deps-win
|
|
uses: actions/cache@v3
|
|
with:
|
|
key: ${{ runner.os }}-deps
|
|
path: build-win-deps
|
|
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
|
|
shell: cmd
|
|
working-directory: ${{ github.workspace }}
|
|
run: build_win.bat release
|
|
|
|
- name: Upload build (release)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: "build-win-release-${{ github.sha }}"
|
|
path: 'build-win/release/'
|
|
if-no-files-found: 'error'
|
|
compression-level: 9
|
|
|
|
### build + upload debug
|
|
- name: Build debug mode
|
|
shell: cmd
|
|
working-directory: ${{ github.workspace }}
|
|
run: build_win.bat debug
|
|
|
|
- name: Upload build (debug)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: "build-win-debug-${{ github.sha }}"
|
|
path: 'build-win/debug/'
|
|
if-no-files-found: 'error'
|
|
compression-level: 9
|
|
|