-
Notifications
You must be signed in to change notification settings - Fork 501
130 lines (109 loc) · 4.99 KB
/
build_android.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
name: "[Android] Build TF Examples"
on:
push:
env:
ANDROID_HOME: "D:\\Android\\android-sdk"
ANDROID_SDK_ROOT: "D:\\Android\\android-sdk"
TF_WORKSPACE: "C:\\TF\\"
jobs:
android:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
platform: [android, quest]
runs-on: ${{ matrix.os }}
steps:
- name: Configure system for maximum build space
shell: pwsh
working-directory: C:\
run: |
Write-Host "Free space before cleanup:"
Get-PSDrive
Write-Host "Removing Android SDK..."
Remove-Item -Path C:\Android -Recurse -ErrorAction Continue
Write-Host "Removing VS2019 and VS2022..."
Remove-Item -Path "C:\Program Files (x86)\Microsoft Visual Studio\2019" -Recurse -ErrorAction Continue
Remove-Item -Path "C:\Program Files\Microsoft Visual Studio\2022" -Recurse -ErrorAction Continue
Write-Host "Symlinking workspace directories onto larger C: drive..."
New-Item -Path $env:TF_WORKSPACE\The-Forge -ItemType Directory | Out-Null
New-Item -Path $env:GITHUB_WORKSPACE\The-Forge -ItemType Junction -Value $env:TF_WORKSPACE\The-Forge -Force | Out-Null
New-Item -Path $env:TF_WORKSPACE\Custom-Middleware -ItemType Directory | Out-Null
New-Item -Path $env:GITHUB_WORKSPACE\Custom-Middleware -ItemType Junction -Value $env:TF_WORKSPACE\Custom-Middleware -Force | Out-Null
New-Item -Path D:\VulkanSDK -ItemType Directory | Out-Null
New-Item -Path C:\VulkanSDK -ItemType Junction -Value D:\VulkanSDK | Out-Null
Write-Host "Free space after cleanup:"
Get-PSDrive
- name: Checkout The-Forge
uses: actions/checkout@v3
with:
path: The-Forge
- name: Checkout Custom-Middleware
uses: actions/checkout@v3
with:
path: Custom-Middleware
repository: ${{ github.repository_owner }}/Custom-Middleware
ref: ${{ github.ref_name }} # Checkout the Custom-Middleware branch with the same name as the The-Forge branch we're building
- name: Install Android SDK
shell: pwsh
run: |
Write-Host "Removing any old Android SDKs..."
Remove-Item -Path "$env:ANDROID_SDK_ROOT" -Recurse -ErrorAction Continue
Write-Host "Downloading commandline-tools..."
Invoke-WebRequest https://dl.google.com/android/repository/commandlinetools-win-8512546_latest.zip -OutFile commandline_tools.zip
Write-Host "Extracting commandline-tools..."
Expand-Archive commandline_tools.zip -DestinationPath commandline_tools_extracted
New-Item "$env:ANDROID_SDK_ROOT/cmdline-tools" -ItemType Directory
Move-Item -Path commandline_tools_extracted/cmdline-tools -Destination "$env:ANDROID_SDK_ROOT/cmdline-tools"
Rename-Item "$env:ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools" -NewName latest
Remove-Item commandline_tools.zip -ErrorAction Continue
Write-Host "Installing Android NDK..."
Set-Location "$env:ANDROID_SDK_ROOT/cmdline-tools/latest/bin/"
Write-Output Y | .\sdkmanager.bat "ndk;21.4.7075529"
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Vulkan SDK
run: choco install vulkan-sdk --version 1.2.162.0
- name: Install VS2017
uses: nick-fields/[email protected]
with:
max_attempts: 3
timeout_minutes: 30
command: choco install VisualStudio2017Community visualstudio2017-workload-nativedesktop visualstudio2017-workload-nativemobile
- name: Install Android Game Development Extension
shell: pwsh
run: |
Write-Host "Downloading AGDE..."
Invoke-WebRequest https://dl.google.com/android/agde/release/62/20220615-181705/AndroidGameDevelopmentExtensionSetup-v22.2.65.exe -OutFile agde_setup.exe
Write-Host "Starting AGDE installer..."
./agde_setup.exe -quiet
Write-Host "Waiting for AGDE installer to close..."
Wait-Process agde_setup
Remove-Item agde_setup.exe -ErrorAction Continue
- name: "[Quest] Install Oculus Mobile SDK"
if: matrix.platform == 'quest'
shell: pwsh
run: |
Write-Host "Downloading Oculus Mobile SDK 1.50..."
Invoke-WebRequest https://securecdn.oculus.com/binaries/download/?id=4643347799061523 -OutFile ovr_sdk_mobile_1.50.0.zip
Write-Host "Extracting Oculus SDK.."
Expand-Archive ovr_sdk_mobile_1.50.0.zip -DestinationPath The-Forge/Common_3/OS/ThirdParty/OpenSource/ovr_sdk_mobile
- name: Setup MSBuild
uses: microsoft/[email protected]
with:
vs-version: '[15.0,16.0)'
- name: Print free space
shell: pwsh
run: Get-PSDrive
- name: Build
working-directory: The-Forge
shell: cmd
run: python -u ./CI/PyBuild.py --preserveworkingdir --prebuild --printbuildoutput --${{ matrix.platform }}
env:
VULKAN_SDK: "C:\\VulkanSDK\\1.2.162.0"
- name: Print free space
if: always()
shell: pwsh
run: Get-PSDrive