forked from stratumauth/app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
78 lines (65 loc) · 2.42 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
trigger:
- master
- develop
pool:
vmImage: ubuntu-latest
variables:
framework: 'net7.0-android'
configuration: 'Debug'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 7 SDK'
inputs:
packageType: 'sdk'
version: 7.x
- task: CmdLine@2
displayName: 'Install Android workload'
inputs:
script: 'dotnet workload install android'
- task: DotNetCoreCLI@2
displayName: 'Run tests'
inputs:
command: 'test'
arguments: '--configuration $(configuration) --collect:"XPlat Code Coverage"'
projects: 'AuthenticatorPro.Test/AuthenticatorPro.Test.csproj'
- task: CmdLine@2
displayName: 'Publish Android'
inputs:
script: 'dotnet publish -f:$(framework) -c:$(configuration) AuthenticatorPro.Droid/AuthenticatorPro.Droid.csproj'
- task: CmdLine@2
displayName: 'Publish WearOS'
inputs:
script: 'dotnet publish -f:$(framework) -c:$(configuration) AuthenticatorPro.WearOS/AuthenticatorPro.WearOS.csproj'
- task: CopyFiles@2
displayName: 'Copy Android APK'
condition: succeeded()
inputs:
contents: 'AuthenticatorPro.Droid/bin/$(configuration)/$(framework)/publish/me.jmh.authenticatorpro-Signed.apk'
targetFolder: $(Build.ArtifactStagingDirectory)
flattenFolders: true
- task: CmdLine@2
displayName: "Rename Android APK"
inputs:
script: 'mv $(Build.ArtifactStagingDirectory)/me.jmh.authenticatorpro-Signed.apk $(Build.ArtifactStagingDirectory)/me.jmh.authenticatorpro.apk'
- task: CopyFiles@2
displayName: 'Copy WearOS APK'
condition: succeeded()
inputs:
contents: 'AuthenticatorPro.WearOS/bin/$(configuration)/$(framework)/publish/me.jmh.authenticatorpro-Signed.apk'
targetFolder: $(Build.ArtifactStagingDirectory)
flattenFolders: true
- task: CmdLine@2
displayName: "Rename WearOS APK"
inputs:
script: 'mv $(Build.ArtifactStagingDirectory)/me.jmh.authenticatorpro-Signed.apk $(Build.ArtifactStagingDirectory)/me.jmh.authenticatorpro.wearos.apk'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
condition: succeeded()
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Agent.TempDirectory)/**/coverage.cobertura.xml'
failIfCoverageEmpty: true