-
Notifications
You must be signed in to change notification settings - Fork 8
135 lines (131 loc) · 5.44 KB
/
uet.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
name: Unreal Engine Tool
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
UET_FRAMEWORK_TARGET: net8.0
UET_DOTNET_WIN_DL: https://download.visualstudio.microsoft.com/download/pr/6902745c-34bd-4d66-8e84-d5b61a17dfb7/e61732b00f7e144e162d7e6914291f16/dotnet-sdk-8.0.101-win-x64.zip
UET_DOTNET_MAC_DL: https://download.visualstudio.microsoft.com/download/pr/ef083c06-7aee-4a4f-b18b-50c9a8990753/e206864e7910e81bbd9cb7e674ff1b4c/dotnet-sdk-8.0.101-osx-arm64.tar.gz
UET_DOTNET_LINUX_DL: https://download.visualstudio.microsoft.com/download/pr/9454f7dc-b98e-4a64-a96d-4eb08c7b6e66/da76f9c6bc4276332b587b771243ae34/dotnet-sdk-8.0.101-linux-x64.tar.gz
UET_DOTNET_WIN_PATH: ./.dotnet-net8.0/dotnet/dotnet.exe
UET_DOTNET_MAC_PATH: ./.dotnet-net8.0/dotnet/dotnet
UET_DOTNET_LINUX_PATH: ./.dotnet-net8.0/dotnet/dotnet
UET_BUILDING_ON_BUILD_SERVER: "true"
jobs:
timestamp:
name: "Timestamp"
runs-on: ubuntu-latest
outputs:
version: ${{ steps.timestamp.outputs.version }}
steps:
- id: timestamp
name: Generate Timestamp
shell: pwsh
run: |
$Timestamp = ([DateTime]::UtcNow)
$PackageVersion = "$($Timestamp.Year).$($Timestamp.DayOfYear + 1000).$(($Timestamp.Hour * 60) + $Timestamp.Minute)"
Set-Content -NoNewline -Path "$env:GITHUB_OUTPUT" -Value "version=$($PackageVersion)"
autodiscovery:
name: "Build AutoDiscovery"
runs-on: windows-latest
needs:
- timestamp
env:
UET_PACKAGE_VERSION: ${{ needs.timestamp.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache .NET SDK
id: cache-sdk
uses: actions/cache@v4
with:
key: dotnet-sdk-windows-${{ env.UET_FRAMEWORK_TARGET }}
restore-keys: dotnet-sdk-windows-${{ env.UET_FRAMEWORK_TARGET }}
path: .dotnet-${{ env.UET_FRAMEWORK_TARGET }}
- if: ${{ steps.cache-sdk.outputs.cache-hit != 'true' }}
name: Download .NET SDK
shell: pwsh
run: |
if (!(Test-Path .dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet\dotnet-extracted)) {
if (Test-Path ".dotnet-${env:UET_FRAMEWORK_TARGET}") {
Remove-Item -Recurse -Force ".dotnet-${env:UET_FRAMEWORK_TARGET}"
}
Write-Host "Setting up .NET SDK..."
New-Item -ItemType Directory ".dotnet-${env:UET_FRAMEWORK_TARGET}" | Out-Null
curl.exe -L -o ".dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet.zip" "${env:UET_DOTNET_WIN_DL}"
if ($LastExitCode -ne 0) {
exit $LastExitCode
}
Expand-Archive -Path ".dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet.zip" -DestinationPath ".dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet" -Force | Out-Null
Set-Content -Path .dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet\dotnet-extracted -Value "done"
}
- name: Add .NET SDK to PATH
shell: pwsh
run: |
Add-Content -Path "${env:GITHUB_PATH}" -Value ".dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet"
- name: Build AutoDiscovery
shell: pwsh
run: |
Write-Host "Building Redpoint.AutoDiscovery version '${env:UET_PACKAGE_VERSION}'..."
dotnet `
msbuild `
-restore `
-p:RuntimeIdentifier=win-x86 `
-p:Configuration=Debug `
-p:Platform=x86 `
"-p:BaseUetVersion=${env:UET_PACKAGE_VERSION}" `
"-p:PackageVersion=${env:UET_PACKAGE_VERSION}" `
UET/Redpoint.AutoDiscovery.Win32/Redpoint.AutoDiscovery.Win32.csproj
if ($LastExitCode -ne 0) { exit $LastExitCode }
dotnet `
msbuild `
-restore `
-p:RuntimeIdentifier=win-x86 `
-p:Configuration=Release `
-p:Platform=x86 `
"-p:BaseUetVersion=${env:UET_PACKAGE_VERSION}" `
"-p:PackageVersion=${env:UET_PACKAGE_VERSION}" `
UET/Redpoint.AutoDiscovery.Win32/Redpoint.AutoDiscovery.Win32.csproj
if ($LastExitCode -ne 0) { exit $LastExitCode }
dotnet `
msbuild `
-restore `
-p:RuntimeIdentifier=win-x64 `
-p:Configuration=Debug `
-p:Platform=x64 `
"-p:BaseUetVersion=${env:UET_PACKAGE_VERSION}" `
"-p:PackageVersion=${env:UET_PACKAGE_VERSION}" `
UET/Redpoint.AutoDiscovery.Win64/Redpoint.AutoDiscovery.Win64.csproj
if ($LastExitCode -ne 0) { exit $LastExitCode }
dotnet `
msbuild `
-restore `
-p:RuntimeIdentifier=win-x64 `
-p:Configuration=Release `
-p:Platform=x64 `
"-p:BaseUetVersion=${env:UET_PACKAGE_VERSION}" `
"-p:PackageVersion=${env:UET_PACKAGE_VERSION}" `
UET/Redpoint.AutoDiscovery.Win64/Redpoint.AutoDiscovery.Win64.csproj
if ($LastExitCode -ne 0) { exit $LastExitCode }
dotnet `
msbuild `
-restore `
-t:Publish `
-p:Configuration=Release `
-p:Platform=AnyCPU `
-p:UsePrebuiltLibsForAutoDiscovery=true `
"-p:BaseUetVersion=${env:UET_PACKAGE_VERSION}" `
"-p:PackageVersion=${env:UET_PACKAGE_VERSION}" `
UET/Redpoint.AutoDiscovery/Redpoint.AutoDiscovery.csproj
if ($LastExitCode -ne 0) { exit $LastExitCode }
- name: Upload AutoDiscovery Package
uses: actions/upload-artifact@v4
with:
name: autodiscovery-nupkg
if-no-files-found: error
path: |
UET/Redpoint.AutoDiscovery/bin/Release/Redpoint.AutoDiscovery.*.nupkg