Skip to content

Commit 685e5e9

Browse files
author
GuillermoGT
authored
Merge pull request #713 from amido/russellseymour/github-release
[4072] Add GitHub release stage to build for `stacks-java`
2 parents c35aa93 + 87ba082 commit 685e5e9

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,3 +788,40 @@ stages:
788788
OAUTH_TOKEN_URL: $(AUTH0_TOKEN_URL),
789789
BASE_URL: "${{ variables.dns_pointer }}",
790790
}
791+
792+
- stage: Release
793+
dependsOn:
794+
- Build
795+
- Prod
796+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['create_release'], 'true'))
797+
variables:
798+
- group: amido-stacks-infra-credentials-nonprod
799+
jobs:
800+
- job: CreateGitHubRelease
801+
pool:
802+
vmImage: $(pool_vm_image)
803+
steps:
804+
# Check out the repo so that it can be tagged
805+
- checkout: self
806+
persistCredentials: true
807+
808+
# Create a tag in the code for this release
809+
- task: Bash@3
810+
displayName: Tag Code
811+
inputs:
812+
targetType: "inline"
813+
script: |
814+
git config user.name "BuildService"
815+
git config user.email "builder@${COMPANY}.com"
816+
git tag -a v${BUILD_BUILDNUMBER} -m "Release created by Azure DevOps"
817+
git push origin v${BUILD_BUILDNUMBER}
818+
env:
819+
COMPANY: $(company)
820+
821+
# Create a GitHub release with these packages
822+
- task: GitHubRelease@0
823+
displayName: Create GitHub Release
824+
inputs:
825+
gitHubConnection: $(github_release_service_connection)
826+
repositoryName: $(github_org)/$(self_repo)
827+
tag: $(Build.BuildNumber)

0 commit comments

Comments
 (0)