-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (127 loc) · 4.81 KB
/
build_windows.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
name: Windows Build - Template
on:
workflow_dispatch:
inputs:
beamProj:
description: "The BEAMPROJ we are building. Ie: BEAMPROJ_Sandbox or BEAMPROJ_HathoraDemo."
required: true
default: "BEAMPROJ_Sandbox"
type: string
buildType:
type: choice
description: 'Either "client", for regular builds, or "server" for dedicated server builds.'
required: true
default: "client"
options:
- "client"
- "server"
targetPlatform:
type: choice
description: 'Either "Win64", for Windows builds, or "Linux" for Linux builds.'
required: true
default: "Win64"
options:
- "Win64"
- "Linux"
gitRevision:
type: string
description: Commit hash to use, can use branch names
required: true
default: dev
workflow_call:
inputs:
beamProj:
description: "The BEAMPROJ we are building. Ie: BEAMPROJ_Sandbox or BEAMPROJ_HathoraDemo."
required: true
default: "BEAMPROJ_Sandbox"
type: string
buildType:
type: string
description: 'Either "client", for regular builds, or "server" for dedicated server builds.'
required: true
default: "client"
targetPlatform:
type: string
description: 'Either "Win64", for Windows builds, or "Linux" for Linux builds.'
required: true
default: "Win64"
gitRevision:
type: string
description: Commit hash to use, can use branch names
required: true
default: dev
permissions:
contents: write
jobs:
build:
runs-on: [self-hosted, Windows]
steps:
# Gets the Unreal Repo and the CLI repo
- uses: actions/checkout@v4
with:
ref: ${{ inputs.gitRevision }}
fetch-depth: 0
lfs: true
path: BeamableUnreal/
- uses: actions/checkout@v4
with:
repository: beamable/BeamableProduct
fetch-depth: 0
lfs: true
path: BeamableProduct/
ref: main
# Caches the UnrealSDK repo's Intermediate and Saved folders
- uses: actions/cache@v4
continue-on-error: false
with:
path: |
BeamableUnreal/Intermediate
BeamableUnreal/Saved
BeamableUnreal/Plugins/BeamableCore/Intermediate
BeamableUnreal/Plugins/BeamableCore/Saved
BeamableUnreal/BeamableUnreal.sln
key: unreal-${{ runner.os }}-${{ inputs.targetPlatform }}-${{ inputs.buildType }}-${{ hashFiles('/BeamableUnreal/Source/**') }}
restore-keys: unreal-${{ runner.os }}-${{ inputs.targetPlatform }}-
# Installs .NET 8 so we can run prepare_repo.sh
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
# Make sure the .NET's paths are added to the shell's path ENV VAR
- run: Add-Content $env:GITHUB_PATH "C:\Program Files\dotnet"
- run: Add-Content $env:GITHUB_PATH "~\.dotnet\tools"
# Run Set-Packages for Unreal
- name: Run Set Packages for local build of the CLI
working-directory: ./BeamableProduct
shell: bash
run: bash set-packages.sh "${{ github.workspace }}/BeamableUnreal/" "UNREAL_NugetSource" "" "" "${{ github.workspace }}/BeamableUnreal/Microservices"
# Run prepare_repo.sh (needed to setup the project correctly locally)
- name: Prepare Repository for compilation
working-directory: ./BeamableUnreal
continue-on-error: true
shell: bash
run: bash prepare_repo.sh skip_waiting
# Sets the BEAMPROJ based on the input to this workflow.
- name: Set BeamProjOverride.txt
working-directory: ./BeamableUnreal
shell: bash
run: |
echo ${{ inputs.beamProj }} > BeamProjOverride.txt |
cat BeamProjOverride.txt
# Builds the image
- name: Build image
working-directory: ./BeamableUnreal
shell: bash
run: bash windows_build.sh ${{ inputs.buildType }} ${{ inputs.targetPlatform }}
# Compress the results
- name: Compress Directory
run: powershell Compress-Archive BeamableUnreal/PackagedProject ${{ inputs.targetPlatform }}_${{ inputs.buildType }}_${{ inputs.beamProj }}_${{ inputs.gitRevision }}.zip
# Uploads the artifacts so we can download the build
- name: Upload Compressed Folder as Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.targetPlatform }}_${{ inputs.buildType }}_${{ inputs.beamProj }}_${{ inputs.gitRevision }}
path: ${{ inputs.targetPlatform }}_${{ inputs.buildType }}_${{ inputs.beamProj }}_${{ inputs.gitRevision }}.zip
- name: Cleanup workspace
if: always()
shell: bash
run: rm -rf .* && rm -rf *