-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaction.yaml
159 lines (151 loc) · 5.8 KB
/
action.yaml
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
name: 'UE5-Build-Project'
description: 'Cook, stage, and package projects for Unreal Engine'
author: 'Orchid Isle Games'
branding:
icon: 'anchor'
color: 'green'
inputs:
RUNUAT_PATH:
description: 'Path to RunUAT.bat'
required: true
UPROJECT_PATH:
description: 'Path to the .uproject file'
required: true
BUILD_CONFIG:
description: 'Configuration to use'
required: true
default: 'Development'
PLATFORM:
description: 'Platform to build for'
required: true
CLEAN:
description: 'Whether to clean'
required: false
default: 'false'
COOK:
description: 'Whether to cook'
required: false
default: 'true'
STAGE:
description: 'Whether to stage'
required: false
default: 'true'
PACKAGE:
description: 'Whether to package'
required: false
default: 'false'
PAK:
description: 'Whether to pak files'
required: false
default: 'false'
SERVER:
description: 'Whether to include the server'
required: false
default: 'false'
ARCHIVE:
description: 'Whether to archive'
required: false
default: 'false'
ARCHIVE_PATH:
description: 'Archive Path'
required: false
NULLRHI:
description: 'Whether to execute commands without video output'
required: false
default: 'false'
EDITOR:
description: 'Whether to compile the editor as well'
required: false
default: 'true'
ENCRYPT_INI:
description: 'Encrypt INI Files'
required: false
default: 'false'
RELEASE:
description: 'Create Release Version (Enter new release version number)'
required: false
default: 'false'
PATCH:
description: 'Generate a patch based on a release version (enter based on release version number)'
required: false
default: 'false'
MAPS:
description: 'Maps to build and package (comma separated list of maps, leave empty for all maps)'
required: false
default: 'true'
DELETE_PDB:
description: 'Delete PDB (debug) files'
required: false
default: 'false'
ANTICHEAT_ENABLED:
description: 'Enable anticheat'
required: false
default: 'false'
ANTICHEAT_PRIVATE_KEY:
description: 'Base64 encoded private key for anticheat'
required: false
ANTICHEAT_PUBLIC_CERT:
description: 'Base64 encoded public certificate for anticheat'
required: false
runs:
using: 'composite'
steps:
- shell: powershell
run: |
$runUatPath = "${{ inputs.RUNUAT_PATH }}"
$uprojectPath = "${{ inputs.UPROJECT_PATH }}"
$uprojectDir = Split-Path -Parent $uprojectPath
$buildConfig = "${{ inputs.BUILD_CONFIG }}"
$platform = "${{ inputs.PLATFORM }}"
$clean = "${{ inputs.CLEAN }}"
$server = "${{ inputs.SERVER }}"
$cook = "${{ inputs.COOK }}"
$stage = "${{ inputs.STAGE }}"
$pak = "${{ inputs.PAK }}"
$package = "${{ inputs.PACKAGE }}"
$archive = "${{ inputs.ARCHIVE }}"
$archivePath = "${{ inputs.ARCHIVE_PATH }}"
$nullrhi = "${{ inputs.NULLRHI }}"
$editor = "${{ inputs.EDITOR }}"
$encryptIni = "${{ inputs.ENCRYPT_INI }}"
$release = "${{ inputs.RELEASE }}"
$patch = "${{ inputs.PATCH }}"
$maps = "${{ inputs.MAPS }}"
$deletePdb = "${{ inputs.DELETE_PDB }}"
$anticheatEnabled = "${{ inputs.ANTICHEAT_ENABLED }}"
$anticheatPrivateKey = "${{ inputs.ANTICHEAT_PRIVATE_KEY }}"
$anticheatPublicCert = "${{ inputs.ANTICHEAT_PUBLIC_CERT }}"
if ($anticheatEnabled -eq 'true') {
$anticheatDir = "$uprojectDir\Build\NoRedist"
if (-Not (Test-Path -Path $anticheatDir)) {
New-Item -Path $anticheatDir -ItemType Directory -Force
}
$privateKeyPath = "$anticheatDir\base_private.key"
$publicCertPath = "$anticheatDir\base_public.cer"
[System.IO.File]::WriteAllBytes($privateKeyPath, [System.Convert]::FromBase64String($anticheatPrivateKey))
[System.IO.File]::WriteAllBytes($publicCertPath, [System.Convert]::FromBase64String($anticheatPublicCert))
Write-Output "Anticheat keys have been written to $anticheatDir"
}
$cleanArg = if ($clean -eq 'true') { "-clean" } else { "" }
$serverArg = if ($server -eq 'true') { "-server -serverplatform=$platform -noclient" } else { "" }
$cookArg = if ($cook -eq 'true') { "-cook" } else { "" }
$stageArg = if ($stage -eq 'true') { "-stage" } else { "" }
$pakArg = if ($pak -eq 'true') { "-pak" } else { "" }
$packageArg = if ($package -eq 'true') { "-package" } else { "" }
$archiveArg = if ($archive -eq 'true') { "-archive -archivedirectory=`"$archivePath`"" } else { "" }
$nullrhiArg = if ($nullrhi -eq 'true') { "-nullrhi" } else { "" }
$editorArg = if ($archive -eq 'true') { "-nocompileeditor" } else { "" }
$encryptIniArg = if ($encryptIni -eq 'true') { "-encryptinifiles" } else { "" }
$releaseArg = if ($release -ne 'false') { "-createreleaseversion=$release" } else { "" }
$patchArg = if ($patch -ne 'false') { "-generatepatch -basedonreleaseversion=$patch" } else { "" }
$mapsArg = if ($maps -eq 'true') { "" } else { "-map=$maps" }
$command = "& `"$runUatPath`" BuildCookRun " +
"-project=`"$uprojectPath`" " +
"-clientconfig=$buildConfig -serverconfig=$buildConfig -platform=$platform $mapsArg " +
"$cleanArg $serverArg $cookArg $stageArg $pakArg $packageArg $archiveArg $editorArg $encryptIniArg $releaseArg $patchArg " +
"-noP4 -build -unattended -utf8output -prereqs $nullrhiArg"
Write-Output "Executing command: $command"
Invoke-Expression $command
if ($deletePdb -eq 'true') {
Get-ChildItem -Path "$uprojectDir\Saved\StagedBuilds\" -Recurse -Filter *.pdb | Remove-Item -Force
}