From 6e8fe27fbc6bd211bb162be8425e3715942fa8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 17:16:17 +0200 Subject: [PATCH 1/9] Try to do a release to github --- azure-pipelines.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 656e8558..1e169f98 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -132,5 +132,30 @@ jobs: options: -H "X-Bintray-Publish:1" remotePath: '' url: https://api.bintray.com/content/luisangelsm/YACReader/DevBuilds/$(Build.BuildNumber)/ +- job: Release + dependsOn: + - Linux + - MacOS + - Windows_x86 + - Windows_x64 + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')) + variables: + - group: github-releases + pool: + vmImage: 'ubuntu-16.04' + steps: + - task: DownloadPipelineArtifact@2 + inputs: + buildType: 'current' + targetPath: $(Build.SourcesDirectory)/dev_bin + - script: | + VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )" + echo "##vso[task.setvariable variable=VERSION]$VERSION" + displayName: 'Create tarball' + - task: GitHubRelease@0 + inputs: + gitHubConnection: YACReader + assets: $(Build.SourcesDirectory)/dev_bin/**/*.*' + title: $VERSION \ No newline at end of file From 78b2d5f3daf29ea5f475f55a96c53584c90e0c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 17:23:07 +0200 Subject: [PATCH 2/9] Use a new connection --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1e169f98..93922a24 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -154,7 +154,7 @@ jobs: displayName: 'Create tarball' - task: GitHubRelease@0 inputs: - gitHubConnection: YACReader + gitHubConnection: yacreader-releases assets: $(Build.SourcesDirectory)/dev_bin/**/*.*' title: $VERSION From 58e4a255a47681dca6e37b741b4f933833d02992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 17:56:50 +0200 Subject: [PATCH 3/9] Disable branch check for releases --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 93922a24..9a7539ad 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -138,7 +138,7 @@ jobs: - MacOS - Windows_x86 - Windows_x64 - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')) + condition: and(succeeded()) variables: - group: github-releases pool: From 012b97642b23c732a2a648bd5b64b259c4a88e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 17:58:23 +0200 Subject: [PATCH 4/9] Fix condition --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9a7539ad..120bf1ed 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -138,7 +138,7 @@ jobs: - MacOS - Windows_x86 - Windows_x64 - condition: and(succeeded()) + condition: succeeded() variables: - group: github-releases pool: From 7b9d41911f98b69025a437bd7ece0f910504e5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 19:10:02 +0200 Subject: [PATCH 5/9] Try to create a tag associated to the release I don't know if it is possible or the tag needs to exists in advance. --- azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 120bf1ed..c49b968e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -157,5 +157,8 @@ jobs: gitHubConnection: yacreader-releases assets: $(Build.SourcesDirectory)/dev_bin/**/*.*' title: $VERSION + tagSource: 'manual' + tag: $VERSION + \ No newline at end of file From eb0f4555ada087f30aba72240c9ad87762c51260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 20:47:51 +0200 Subject: [PATCH 6/9] Use VERSION var properly --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c49b968e..99739720 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -156,9 +156,9 @@ jobs: inputs: gitHubConnection: yacreader-releases assets: $(Build.SourcesDirectory)/dev_bin/**/*.*' - title: $VERSION + title: $(VERSION) tagSource: 'manual' - tag: $VERSION + tag: $(VERSION) \ No newline at end of file From a89e197addab678dfad9ea03d0695d68a115193e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 20:49:18 +0200 Subject: [PATCH 7/9] Artifacts in $(Build.ArtifactStagingDirectory) should be automatically uploaded So downloading the artifacts to that folder and then flatten it should get the files ready to be uploaded --- azure-pipelines.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 99739720..7de0662c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -147,15 +147,17 @@ jobs: - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' - targetPath: $(Build.SourcesDirectory)/dev_bin + targetPath: $(Build.ArtifactStagingDirectory) + - script: | + find $(Build.ArtifactStagingDirectory) -name '*.*' -exec cp {} $(Build.ArtifactStagingDirectory) \; + displayName: 'flatten artifact staging directory' - script: | VERSION="$(cat common/yacreader_global.h | grep '#define VERSION "' | tr -d '#define VERSION' | tr -d '"' )" echo "##vso[task.setvariable variable=VERSION]$VERSION" - displayName: 'Create tarball' + displayName: 'Version' - task: GitHubRelease@0 inputs: gitHubConnection: yacreader-releases - assets: $(Build.SourcesDirectory)/dev_bin/**/*.*' title: $(VERSION) tagSource: 'manual' tag: $(VERSION) From 16bbb9ab485b0c0085ad51ad1e820e849d0a76a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 21:43:51 +0200 Subject: [PATCH 8/9] Do releases only when merging into master --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7de0662c..d1ccab8d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -138,7 +138,7 @@ jobs: - MacOS - Windows_x86 - Windows_x64 - condition: succeeded() + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) variables: - group: github-releases pool: From c2ef314be2c706a66e84c85a1992265a0028fe00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20A=CC=81ngel=20San=20Marti=CC=81n?= Date: Mon, 16 Sep 2019 21:51:02 +0200 Subject: [PATCH 9/9] Disable adding a changelog based on commits It is too verbose. --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d1ccab8d..4e6b7200 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -161,6 +161,7 @@ jobs: title: $(VERSION) tagSource: 'manual' tag: $(VERSION) + addChangeLog: false \ No newline at end of file