-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
100 lines (97 loc) · 3.41 KB
/
build-android.yml
File metadata and controls
100 lines (97 loc) · 3.41 KB
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
name: Build Android Runtime
on:
pull_request:
paths:
- '.github/workflows/build-android.yml'
- 'build/Stride.Android.slnf'
# - 'deps/**'
# - 'sources/core/**'
# - 'sources/engine/**'
# - 'sources/native/**'
# - 'sources/shaders/**'
# - 'sources/shared/**'
# - 'sources/sdk/**'
- '!**/.all-contributorsrc'
- '!**/.editorconfig'
- '!**/.gitignore'
- '!**/*.md'
- '!crowdin.yml'
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
inputs:
build-type:
description: Build Configuration
default: Debug
type: choice
options:
- Debug
- Release
workflow_call:
inputs:
build-type:
default: Debug
type: string
concurrency:
group: build-android-${{ github.event.pull_request.number || github.ref }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
cancel-in-progress: true
jobs:
#
# Build Stride Runtime for Android
#
Android-Runtime:
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event.pull_request.draft == false }}
name: Build (${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }})
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Install Android Workload
run: dotnet workload install android
- name: Remove Conflicting NDK
shell: pwsh
run: |
$conflictingNdk = "C:\Android\android-sdk\ndk\26.3.11579264"
if (Test-Path $conflictingNdk) {
Write-Host "Removing conflicting NDK 26.3.11579264"
Remove-Item -Path $conflictingNdk -Recurse -Force
}
- name: Setup Android
uses: android-actions/setup-android@v3
with:
cmdline-tools-version: 12266719
accept-android-sdk-licenses: true
log-accepted-android-sdk-licenses: true
packages: tools platform-tools ndk;21.4.7075529
- name: Configure NDK Environment
shell: pwsh
run: |
$ndkPath = "$env:ANDROID_SDK_ROOT\ndk\21.4.7075529"
echo "ANDROID_NDK_ROOT=$ndkPath" >> $env:GITHUB_ENV
echo "ANDROID_NDK_HOME=$ndkPath" >> $env:GITHUB_ENV
echo "Using NDK at: $ndkPath"
- uses: microsoft/setup-msbuild@v2
- uses: ./.github/actions/build-sdk
- name: Debug NDK Configuration
shell: pwsh
run: |
Write-Host "ANDROID_SDK_ROOT: $env:ANDROID_SDK_ROOT"
Write-Host "ANDROID_NDK_ROOT: $env:ANDROID_NDK_ROOT"
Write-Host "ANDROID_NDK_HOME: $env:ANDROID_NDK_HOME"
Write-Host "NDK Path exists: $(Test-Path $env:ANDROID_NDK_ROOT)"
if (Test-Path "$env:ANDROID_NDK_ROOT\source.properties") {
Get-Content "$env:ANDROID_NDK_ROOT\source.properties"
}
- name: Build
run: |
msbuild build\Stride.Android.slnf `
-restore -m:1 -nr:false `
-v:m -p:WarningLevel=0 `
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} `
-p:StridePlatforms=Android `
-p:StrideSkipUnitTests=true `
-p:StrideSkipAutoPack=true `
-p:_AndroidNdkDirectory="$env:ANDROID_NDK_ROOT"