-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
82 lines (70 loc) · 2.74 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
trigger:
branches:
include:
- main
pr: none
variables:
FlutterChannel: 'stable'
FlutterVersion: 'latest'
ProjectSlug: '<APP_CENTER_USERNAME>/<APP_CENTER_APP>'
ProjectDirectory: '$(Build.SourcesDirectory)'
BuildNumber: '$(Build.BuildNumber)'
BuildMessage: '$(Build.SourceVersionMessage)'
BuildDirectory: '$(ProjectDirectory)/build/app/outputs/apk/release/app-release.apk'
jobs:
- job: Build
pool:
vmImage: 'macOS-latest'
steps:
- task: FlutterInstall@0
displayName: Setup flutter
- task: PowerShell@2
displayName: Setup environment
inputs:
targetType: 'inline'
script: |
Write-Host "##vso[task.prependpath]$(JAVA_HOME_11_X64)"
Write-Host "##vso[task.setvariable variable=JAVA_HOME;]$(JAVA_HOME_11_X64)"
Write-Host "##vso[task.prependpath]$(FlutterToolPath)"
Write-Host "##vso[task.prependpath]$(FlutterToolPath)/cache/dart-sdk/bin"
- task: PowerShell@2
displayName: Setup variables (beta)
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/')
inputs:
targetType: 'inline'
script: |
$buildName = "$(Build.SourceVersion)".SubString(0,7)
$distributionGroup = "<APP_CENTER_BETA_DISTRIBUTION_GROUP_ID>"
Write-Host "##vso[task.setvariable variable=BuildName;]$buildName"
Write-Host "##vso[task.setvariable variable=DistributionGroup;]$distributionGroup"
- task: PowerShell@2
displayName: Setup variables (public)
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
inputs:
targetType: 'inline'
script: |
$buildName = "$(Build.SourceBranch)".SubString(11)
$distributionGroup = "<APP_CENTER_PUBLIC_DISTRIBUTION_GROUP_ID>"
Write-Host "##vso[task.setvariable variable=BuildName;]$buildName"
Write-Host "##vso[task.setvariable variable=DistributionGroup;]$distributionGroup"
- task: CmdLine@2
displayName: Run install
inputs:
script: 'flutter pub get'
- task: FlutterBuild@0
displayName: Run build
inputs:
target: 'apk'
projectDirectory: '$(ProjectDirectory)'
buildName: '$(BuildName)'
buildNumber: '$(BuildNumber)'
# - task: AppCenterDistribute@3
# displayName: Run distribute
# inputs:
# serverEndpoint: 'AppCenter Service Connection'
# appSlug: '$(ProjectSlug)'
# appFile: '$(BuildDirectory)'
# releaseNotesOption: 'input'
# releaseNotesInput: '$(BuildMessage)'
# destinationType: 'groups'
# distributionGroupId: '$(DistributionGroup)'