forked from illuscio-dev/azure-pipelines-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit_update_release_branch.yml
36 lines (32 loc) · 1.12 KB
/
git_update_release_branch.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
parameters:
# The branch to push passing 'dev' builds into.
- name: releaseBranchName
type: string
steps:
# Create a temp branch to commit our changes to.
- script: |
git checkout -b tempBuildBranch
git add -A .
git commit -am "release build for $(RELEASE_VERSION)"
displayName: Commit changes to temp branch & add build files
condition: succeeded()
# Merge into master, resolving conflicts by favoring our temp branch.
- script: |
git push -f origin tempBuildBranch:${RELEASE_BRANCH}
displayName: 'Push Build to Release Branch'
condition: succeeded()
env:
RELEASE_BRANCH: ${{ parameters.releaseBranchName }}
# Tag with the release version as well as 'latest' and push the tag.
- script: |
git checkout $(RELEASE_BRANCH)
git pull
git tag -d latest
git tag -a v$(RELEASE_VERSION) -m "azure pipelines build $(Build.BuildNumber)"
git tag -a latest -m "azure pipelines build $(Build.BuildNumber)"
git push origin :refs/tags/latest
git push --tags
displayName: 'Publish tagged version.'
condition: succeeded()
env:
RELEASE_BRANCH: ${{ parameters.releaseBranchName }}