-
Notifications
You must be signed in to change notification settings - Fork 17
165 lines (133 loc) · 4.3 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
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}}