Skip to content

Build

Build #775

Workflow file for this run

name: Build
on:
push:
branches: [main]
schedule:
- cron: "0 0 * * *"
jobs:
sources:
name: Get source data
runs-on: ubuntu-latest
outputs:
outcome: ${{steps.commit.outcome}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 'pypy3.9'
cache: 'pip'
- name: Install Python Dependencies
run: pip install -r requirements.txt
- name: Get Unreal Engine Ref
uses: octokit/request-action@v2.x
id: get-unreal-ref
with:
route: GET /repos/EpicGames/UnrealEngine/branches/ue5-main
env:
GITHUB_TOKEN: ${{secrets.PAT_TOKEN}}
- name: Cache Unreal Engine
id: cache-unreal
uses: actions/cache@v4
with:
path: unreal
key: unreal-${{fromJson(steps.get-unreal-ref.outputs.data).commit.sha}}
- name: Checkout Unreal Engine
if: steps.cache-unreal.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{fromJson(steps.get-unreal-ref.outputs.data).commit.sha}}
repository: EpicGames/UnrealEngine
token: ${{secrets.PAT_TOKEN}}
path: unreal
- name: Download Oodle Dependencies
run: python download_oodle.py
- name: Commit Changes
id: commit
continue-on-error: true
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add .
git commit -m "Automatic Update" --author="${{github.actor}} <${{github.actor}}@users.noreply.github.com>"
- name: Push Changes
if: ${{steps.commit.conclusion == 'success'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{secrets.GITHUB_TOKEN}}
branch: ${{github.ref}}
build:
name: Build
needs: sources
strategy:
fail-fast: false
matrix:
configure-preset: [msvc, clang-cl, clang, gcc]
build-preset: [debug, release]
include:
- configure-preset: msvc
os: windows-2022
- configure-preset: clang-cl
os: windows-2022
- configure-preset: clang
os: ubuntu-latest
- configure-preset: gcc
os: ubuntu-latest
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{github.ref}}
- name: "[Ubuntu] Remove GCC 13 from runner image"
uses: mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8
with:
os: ${{matrix.os}}
- name: Get CMake
uses: lukka/get-cmake@latest
- name: Run Vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '9558037875497b9db8cf38fcd7db68ec661bffe7'
vcpkgJsonGlob: 'build/vcpkg.json'
- name: Run CMake
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: 'build/CMakeLists.txt'
configurePreset: '${{matrix.configure-preset}}'
buildPreset: '${{matrix.configure-preset}}-${{matrix.build-preset}}'
- name: Zip Artifacts
run: python zip_artifacts.py '${{github.workspace}}/build/builds/${{matrix.configure-preset}}' '${{matrix.configure-preset}}-${{matrix.build-preset}}.zip'
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{matrix.configure-preset}}-${{matrix.build-preset}}
path: ${{matrix.configure-preset}}-${{matrix.build-preset}}.zip
release:
name: Create Release
needs: [build, sources]
if: needs.sources.outputs.outcome == 'success' || github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- name: Grab Python File
uses: actions/checkout@v4
with:
sparse-checkout: create_release.py
- name: Download Built Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create Release Zips
run: python ../create_release.py
working-directory: artifacts
- name: Get Current Date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: artifacts/*.zip
tag: ${{steps.date.outputs.date}}-${{github.run_number}}