Skip to content

Commit

Permalink
enable patch releases, attempt 2 (#5605)
Browse files Browse the repository at this point in the history
It looks like Azure strips everything up to the last `/` when using
`SourceBranchName`, which means that variable does not map to git's
notion of a branch's name. According to the
[documentation](https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml),
using the full `SourceBranch` instead might work.

p.s. I have learned my lesson: I'll only update the master branch to
match once I get this working.

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
garyverhaegen-da authored Apr 17, 2020
1 parent ea5ca48 commit 722bac9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
condition: and(succeeded(),
eq(dependencies.check_for_release.outputs['out.is_release'], 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')))
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
pool:
vmImage: "Ubuntu-16.04"
variables:
Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
vmImage: "Ubuntu-16.04"
condition: and(eq(dependencies.check_for_release.outputs['out.is_release'], 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')))
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
variables:
release_sha: $[ dependencies.check_for_release.outputs['out.release_sha'] ]
release_tag: $[ dependencies.check_for_release.outputs['out.release_tag'] ]
Expand Down
8 changes: 4 additions & 4 deletions ci/build-unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ steps:
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')),
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')),
eq('${{parameters.name}}', 'linux'))
- bash: |
set -euo pipefail
Expand All @@ -83,21 +83,21 @@ steps:
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')))
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
- task: PublishPipelineArtifact@0
inputs:
targetPath: $(Build.StagingDirectory)/$(publish.tarball)
artifactName: $(publish.tarball)
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')))
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
- task: PublishPipelineArtifact@0
inputs:
targetPath: $(Build.StagingDirectory)/$(publish.protos-zip)
artifactName: $(publish.protos-zip)
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')),
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')),
eq('${{parameters.name}}', 'linux'))
6 changes: 3 additions & 3 deletions ci/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ steps:
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')))
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
- task: PublishPipelineArtifact@0
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')))
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
inputs:
targetPath: $(Build.StagingDirectory)/$(publish.installer)
artifactName: $(publish.installer)
- task: PublishPipelineArtifact@0
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')))
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
inputs:
targetPath: $(Build.StagingDirectory)/$(publish.tarball)
artifactName: $(publish.tarball)
2 changes: 1 addition & 1 deletion ci/tell-slack-failed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ steps:
$(Slack.team-daml)
condition: and(failed(),
or(eq(variables['Build.SourceBranchName'], 'master'),
startsWith(variables['Build.SourceBranchName'], 'release/')))
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))

0 comments on commit 722bac9

Please sign in to comment.