3535 - checkout : self # represents the repo where the initial Pipelines YAML file was found
3636 submodules : recursive # set to 'recursive' to get submodules of submodules
3737
38- # read version file
39- - bash : |
40- echo "##vso[task.setvariable variable=semVer]$(cat version)"
41- echo "##vso[task.setvariable variable=preRel]$(grep -oE 'alpha|beta' version)"
42- workingDirectory: '$(Build.SourcesDirectory)'
43- displayName: 'Read and generate pipeline variables'
44-
4538 # build process
4639 - bash : ./.ci/ci_build.sh
4740 displayName : ' Build $(dockerName) packages'
@@ -50,41 +43,19 @@ jobs:
5043 DOCKER_NAME : $(dockerName)
5144 PLATFORM : $(platform)
5245
53- # copy files
54- - bash : ' cp -v deploy/Hyperion-* $(Build.ArtifactStagingDirectory) 2>/dev/null || :'
55- workingDirectory : ' $(Build.SourcesDirectory)'
46+ # move files
47+ - bash : ' mv -v deploy/Hyperion-* $(Build.ArtifactStagingDirectory) 2>/dev/null || :'
48+ workingDirectory : $(Build.SourcesDirectory)
5649 condition : and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
57- displayName : ' Collecting deployable artifacts'
50+ displayName : ' Collect artifacts'
5851
5952 # publish artifacts
6053 - task : PublishBuildArtifacts@1
6154 inputs :
62- pathtoPublish : ' $(Build.ArtifactStagingDirectory)'
55+ pathtoPublish : $(Build.ArtifactStagingDirectory)
6356 ArtifactName : $(dockerTag)
6457 condition : and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
65- displayName : ' Publish deployables artifacts'
66-
67- # set release to pre-release
68- - bash : echo '##vso[task.setvariable variable=preRelease;]true'
69- condition : and(succeeded(), or(contains(variables['preRel'], 'alpha'), contains(variables['preRel'], 'beta')), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
70- displayName : ' Mark alpha or beta as pre-release'
71-
72- # create or update github release
73- - task : GithubRelease@0
74- inputs :
75- gitHubConnection : ' Hyperion-Bot'
76- repositoryName : $(Build.Repository.Name)
77- action : edit
78- target : $(Build.SourceVersion)
79- tagSource : manual
80- tag : $(Build.SourceBranchName)
81- title : ' Hyperion $(semVer)'
82- assets : ' $(Build.ArtifactStagingDirectory)/*'
83- assetUploadMode : ' replace'
84- addChangeLog : false
85- isPreRelease : $(preRelease)
86- condition : and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
87- displayName : Create/Update GitHub release
58+ displayName : ' Publish artifacts'
8859
8960# #####################
9061# ##### macOS #########
@@ -99,55 +70,85 @@ jobs:
9970 - checkout : self # represents the repo where the initial Pipelines YAML file was found
10071 submodules : recursive # set to 'recursive' to get submodules of submodules
10172
102- # read version file
103- - bash : |
104- echo "##vso[task.setvariable variable=semVer]$(cat version)"
105- echo "##vso[task.setvariable variable=preRel]$(grep -oE 'alpha|beta' version)"
106- workingDirectory: '$(Build.SourcesDirectory)'
107- displayName: 'Read and generate pipeline variables'
108-
10973 # install dependencies
11074 - bash : ./.ci/ci_install.sh
11175 displayName : ' Install dependencies'
11276
11377 # build process
11478 - bash : ./.ci/ci_build.sh
115- displayName : ' Build macOS 10.13 packages'
11679 env :
11780 PLATFORM : ' osx'
81+ condition : succeeded()
82+ displayName : ' Build macOS 10.13 packages'
11883
119- # copy files
120- - bash : ' cp -v build/Hyperion-* $(Build.ArtifactStagingDirectory) 2>/dev/null || :'
121- workingDirectory : ' $(Build.SourcesDirectory)'
84+ # move files
85+ - bash : ' mv -v build/Hyperion-* $(Build.ArtifactStagingDirectory) 2>/dev/null || :'
86+ workingDirectory : $(Build.SourcesDirectory)
12287 condition : and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
123- displayName : ' Collecting deployable artifacts'
88+ displayName : ' Collect artifacts'
12489
12590 # publish artifacts
12691 - task : PublishBuildArtifacts@1
12792 inputs :
128- pathtoPublish : ' $(Build.ArtifactStagingDirectory)'
93+ pathtoPublish : $(Build.ArtifactStagingDirectory)
12994 ArtifactName : ' macos'
13095 condition : and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
131- displayName : ' Publish deployables artifacts'
96+ displayName : ' Publish artifacts'
97+
98+ # ###############################
99+ # ##### Publish Releases ########
100+ # ###############################
101+
102+ - job : PublishReleases
103+ timeoutInMinutes : 120
104+ dependsOn :
105+ - Linux
106+ - macOS
107+ condition : and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
108+ pool :
109+ vmImage : ubuntu-16.04
110+
111+ steps :
112+ - checkout : self # represents the repo where the initial Pipelines YAML file was found
113+
114+ # download deployables artifacts
115+ - task : DownloadPipelineArtifact@2
116+ inputs :
117+ path : $(Build.ArtifactStagingDirectory)
118+ displayName : Download artifacts
119+
120+ # read version file
121+ - bash : |
122+ echo "##vso[task.setvariable variable=semVer]$(cat version)"
123+ echo "##vso[task.setvariable variable=preRel]$(grep -oE 'alpha|beta' version)"
124+ workingDirectory: '$(Build.SourcesDirectory)'
125+ condition: succeeded()
126+ displayName: 'Read and generate pipeline variables'
132127
133128 # set release to pre-release
134129 - bash : echo '##vso[task.setvariable variable=preRelease;]true'
135130 condition : and(succeeded(), or(contains(variables['preRel'], 'alpha'), contains(variables['preRel'], 'beta')), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
136131 displayName : ' Mark alpha or beta as pre-release'
137132
138- # create or update github release
133+ # create github releases
139134 - task : GithubRelease@0
140135 inputs :
141- gitHubConnection : ' Hyperion-Bot'
136+ gitHubConnection : Hyperion-Bot
142137 repositoryName : $(Build.Repository.Name)
143- action : edit
138+ action : create
144139 target : $(Build.SourceVersion)
145140 tagSource : manual
146- tag : ' $(Build.SourceBranchName)'
141+ tag : $(Build.SourceBranchName)
147142 title : ' Hyperion $(semVer)'
148- assets : ' $(Build.ArtifactStagingDirectory)/*'
143+ assets : |
144+ $(Build.ArtifactStagingDirectory)/amd64/*
145+ $(Build.ArtifactStagingDirectory)/i386/*
146+ $(Build.ArtifactStagingDirectory)/armv6hf/*
147+ $(Build.ArtifactStagingDirectory)/armv7hf/*
148+ $(Build.ArtifactStagingDirectory)/aarch64/*
149+ $(Build.ArtifactStagingDirectory)/macos/*
149150 assetUploadMode : ' replace'
150151 addChangeLog : false
151152 isPreRelease : $(preRelease)
152- condition : and( succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/') )
153- displayName : Create/Update GitHub release
153+ condition : succeeded()
154+ displayName : Create GitHub releases
0 commit comments