-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (79 loc) · 2.82 KB
/
build_windows_oapi.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
name: Windows Build - OpenAPI Generation
on:
workflow_call:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: [self-hosted, Windows]
steps:
# Gets the Unreal Repo and the CLI repo
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
path: BeamableUnreal
- uses: actions/checkout@v4
with:
repository: beamable/BeamableProduct
fetch-depth: 0
lfs: true
path: BeamableProduct/
ref: main
# Sets the buildType ENV var as either server or client.
- name: Set buildType ENV var
id: set-build-type
run: echo "buildType=client" >> $env:GITHUB_ENV
- name: Set hash ENV var
id: get_commit_hash
working-directory: BeamableUnreal
run: echo "commit_hash=$(git rev-parse HEAD)" >> $env:GITHUB_ENV
- name: Check buildType ENV var
id: check-build-type
run: echo "${{ env.buildType }}"
# Installs .NET 8 so we can run init_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"
- name: Check for Changes
working-directory: ./BeamableUnreal
id: changes
shell: bash
run: |
modified="$(git diff -b -- 'Plugins/**/*.h' 'Plugins/**/*.cpp')"
lines=$(echo "${modified}" | wc -l)
if [ "$lines" -eq 0 ]; then
echo "any=false" >> $GITHUB_OUTPUT
else
echo "any=true" >> $GITHUB_OUTPUT
echo "Modified: ${modified}"
fi
# Run init_repo.sh (needed to setup the project correctly locally)
- name: Prepare Repository for compilation
working-directory: BeamableUnreal
shell: bash
run: bash init_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 "BEAMPROJ_SteamDemo" > BeamProjOverride.txt |
cat BeamProjOverride.txt
# Builds the image
- name: Build image
working-directory: BeamableUnreal
shell: bash
run: bash windows_build.sh
- name: Cleanup workspace
shell: bash
run: rm -rf .* && rm -rf *