-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
97 lines (80 loc) · 3.57 KB
/
azure-pipelines.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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'windows-2019'
# make sure you have set variables for followings at AzureDevOps Pipeline Variable configuration UI.
# https://dev.azure.com/YOUR_ORG/YOUR_PROJECT/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=YOUR_ID&view=Tab_Variables
#variables:
#unity.username: YOUR_USER_NAME_AS_SECRET
#unity.password: YOUR_USER_PASSWORD_AS_SECRET
#unity.serialkey: YOUR_UNITY_SERIALKEY_AS_SECRET
steps:
- checkout: self
clean: true
fetchDepth: 1
lfs: false
# YAML Build not support output variable but you can get task output variable with `name` key.
# refer: https://developercommunity.visualstudio.com/content/problem/335706/output-variable-set-in-the-vsts-task-does-not-show.html
# use name instead to reference output variable.
- task: DinomiteStudios.64e90d50-a9c0-11e8-a356-d3eab7857116.custom-unity-get-project-version-task.UnityGetProjectVersionTask@1
displayName: 'Unity Get Project Version'
name: unitygetprojectversion
- pwsh: Install-Module -Name UnitySetup -AllowPrerelease -Scope CurrentUser -Force
displayName: 'Install UnitySetup Module'
failOnStderr: true
- pwsh: Install-UnitySetupInstance -Installers (Find-UnitySetupInstaller -Version '$(unitygetprojectversion.projectVersion)' -Components Windows,UWP_IL2CPP) -Verbose
displayName: 'Install Unity'
failOnStderr: true
- task: DinomiteStudios.64e90d50-a9c0-11e8-a356-d3eab7857116.custom-unity-activate-license-task.UnityActivateLicenseTask@1
displayName: 'Unity Activate License'
inputs:
username: '$(unity.username)'
password: '$(unity.password)'
serial: '$(unity.serialkey)'
- script: dotnet tool install --global UnityBuildRunner
displayName: 'Install UnityBuildRunner'
- script: |
set UnityPath=C:\Program Files\Unity\Hub\Editor\$(unitygetprojectversion.projectVersion)\Editor\Unity.exe
UnityBuildRunner -quit -batchmode -projectPath $(Build.Repository.LocalPath) -buildTarget WSAPlayer -logfile $(Build.ArtifactStagingDirectory)\Editor.log -executeMethod HoloToolkit.Unity.BuildDeployTools.BuildSLN
displayName: 'Unity Build'
# UnityBuildTask@2 could not show build status, and is failed to build....
# - task: DinomiteStudios.64e90d50-a9c0-11e8-a356-d3eab7857116.custom-unity-build-task.UnityBuildTask@2
# displayName: 'Unity Build WindowsStoreApps'
# inputs:
# buildTarget: WindowsStoreApps
# commandLineArgumentsMode: custom
# customCommandLineArguments: '-ExecuteMethod HoloToolkit.Unity.BuildDeployTools.BuildSLN -logfile $(Build.ArtifactStagingDirectory)/Editor.log'
# continueOnError: true
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact'
inputs:
artifactName: 'unity_build_log'
targetPath: '$(Build.ArtifactStagingDirectory)'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet'
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: 'UWP/*.sln'
# if you want to build locally
# - task: PublishPipelineArtifact@0
# displayName: 'Publish Pipeline Artifact'
# inputs:
# artifactName: 'UWP_Sln'
# targetPath: 'UWP'
- task: MSBuild@1
displayName: 'Build solution'
inputs:
solution: 'UWP'
platform: x86
configuration: Release
msbuildArguments: '/P:PlatformToolset=v142;AppxBundle=Always;AppxBundlePlatforms=x86'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact'
inputs:
artifactName: 'apppackages'
targetPath: 'UWP/AppPackages'