forked from HolyManoly/XRTest
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (92 loc) · 3.5 KB
/
build.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
name: build
on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
clean:
description: 'Clean the project before building'
required: false
default: false
type: 'boolean'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ ( github.event_name == 'pull_request' || github.event.action == 'synchronize' ) }}
jobs:
build:
env:
UNITY_PROJECT_PATH: '' # set by unity-setup action
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, buildalon-windows]
build-target: [WSAPlayer]
steps:
- uses: actions/checkout@v4
with:
clean: ${{ github.event.inputs.clean == 'true' }}
- uses: buildalon/unity-setup@v1
with:
version-file: ${{ github.workspace }}/ProjectSettings/ProjectVersion.txt
build-targets: ${{ matrix.build-target }}
- uses: buildalon/activate-unity-license@v1
with:
license: 'Personal'
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
- uses: buildalon/unity-action@v1
name: '${{ matrix.build-target }}-Validate'
with:
build-target: ${{ matrix.build-target }}
log-name: '${{ matrix.build-target }}-Validate'
args: '-quit -nographics -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset'
- uses: buildalon/unity-action@v1
name: '${{ matrix.build-target }}-Build'
with:
build-target: ${{ matrix.build-target }}
log-name: '${{ matrix.build-target }}-Build'
args: '-quit -nographics -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity -arch ARM64'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- uses: microsoft/setup-msbuild@v2
- uses: buildalon/unity-uwp-builder@v1
id: uwp-build
with:
project-path: ${{ env.UNITY_PROJECT_PATH }}/Builds/WSAPlayer
package-type: 'sideload'
- name: print outputs
shell: bash
run: |
echo "Executable: ${{ steps.uwp-build.outputs.executable }}"
echo "Output Directory: ${{ steps.uwp-build.outputs.output-directory }}"
ls -R "${{ steps.uwp-build.outputs.output-directory }}"
- uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ${{ matrix.os }}-${{ matrix.build-target }}.${{ github.run_number }}.${{ github.run_attempt }}
path: |
${{ github.workspace }}/**/*.log
${{ steps.uwp-build.outputs.output-directory }}
- name: Clean Artifacts
if: always()
shell: pwsh
run: |
# Clean Logs
Get-ChildItem -Path "${{ env.UNITY_PROJECT_PATH }}" -File -Filter "*.log" -Recurse | Remove-Item -Force
$artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds"
Write-Host "::debug::Build artifacts path: $artifacts"
if (Test-Path -Path $artifacts) {
try {
Remove-Item $artifacts -Recurse -Force
} catch {
Write-Warning "Failed to delete artifacts folder file: $_"
}
} else {
Write-Host "::debug::Artifacts folder not found."
}