Skip to content

Build

Build #294

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@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
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@v3
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@v3
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@v3
with:
ref: ${{ github.ref }}
- name: Get CMake
uses: lukka/get-cmake@latest
- name: Run Vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgGitCommitId: '1370b2c88f1e683c5c6a2465133eaa9a9b3ee679'
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@v3
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: Bhacaz/checkout-files@v2
with:
files: create_release.py
- name: Download built artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Create release zips
run: python ../create_release.py
working-directory: artifacts
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: artifacts/*.zip
tag: ${{ github.run_id }}