CI / build (push) Successful in 39s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
60 lines
2.7 KiB
YAML
60 lines
2.7 KiB
YAML
# Builds the adapter (32-bit) and the renderer process (64-bit), runs the tests, and publishes both programs: pushes to
|
|
# main replace the nightly pre-release, vX.Y.Z tags make release X.Y.Z (.gitea/scripts/release.py).
|
|
#
|
|
# Runs on T5DE's Windows runner (label `windows`, jobs run directly on the machine: it needs Visual Studio's
|
|
# compiler). The checkout lives in a fixed folder there ($T5DE_BUILD_ROOT, set in the runner's config), so Diligent
|
|
# Engine is fetched and built once, not on every run. Never on pull requests: their code would run on that machine.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows
|
|
defaults:
|
|
run:
|
|
# Steps run as script files, which Windows' default execution policy refuses.
|
|
shell: powershell -NoProfile -ExecutionPolicy Bypass -Command ". '{0}'"
|
|
steps:
|
|
- name: Check out
|
|
env:
|
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
function git { & git.exe -c "http.extraHeader=Authorization: token $env:TOKEN" @args; if ($LASTEXITCODE) { exit $LASTEXITCODE } }
|
|
$root = if ($env:T5DE_BUILD_ROOT) { $env:T5DE_BUILD_ROOT } else { $env:GITHUB_WORKSPACE }
|
|
$src = Join-Path $root ($env:GITHUB_REPOSITORY -replace '/', '-')
|
|
if (-not (Test-Path (Join-Path $src .git))) { git init -q $src }
|
|
Set-Location $src
|
|
git fetch -q --force --tags "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY" "+${env:GITHUB_REF}:refs/remotes/ci/head"
|
|
git checkout -q --force --detach $env:GITHUB_SHA
|
|
git clean -q -ffdx -e /build/
|
|
"T5DE_SRC=$src" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
|
|
|
|
- name: Build and test the adapter
|
|
working-directory: ${{ env.T5DE_SRC }}
|
|
run: cmake --workflow --preset adapter
|
|
|
|
- name: Build the renderer process
|
|
working-directory: ${{ env.T5DE_SRC }}
|
|
run: cmake --workflow --preset renderer
|
|
|
|
- name: Collect the programs
|
|
working-directory: ${{ env.T5DE_SRC }}
|
|
run: |
|
|
cmake --install build/windows-x86 --config Release --prefix dist
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
cmake --install build/windows-x64 --config Release --prefix dist
|
|
|
|
- name: Publish the release
|
|
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
|
working-directory: ${{ env.T5DE_SRC }}
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# Optional: a Discord webhook URL that nightlies are announced on.
|
|
DISCORD_NIGHTLY_WEBHOOK: ${{ secrets.DISCORD_NIGHTLY_WEBHOOK }}
|
|
run: python .gitea/scripts/release.py publish dist
|