Skip to content

Commit

Permalink
Add GitHub release stage to build for stacks-java-cqrs (#212)
Browse files Browse the repository at this point in the history
Add GitHub release stage to build for stacks-java-cqrs
  • Loading branch information
GuillermoGT authored Dec 17, 2021
1 parent 16222f3 commit 2bfe3fe
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ variables:
value: 0
- name: version_patch
value: 0
- name: version_number
value: $(version_major).$(version_minor).$(version_patch)

# PR / Branch vars
- name: source_branch_ref
Expand Down Expand Up @@ -789,3 +791,40 @@ stages:
OAUTH_TOKEN_URL: $(AUTH0_TOKEN_URL),
BASE_URL: "${{ variables.dns_pointer }}",
}

- stage: Release
dependsOn:
- Build
- Prod
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['create_release'], 'true'))
variables:
- group: amido-stacks-infra-credentials-nonprod
jobs:
- job: CreateGitHubRelease
pool:
vmImage: $(pool_vm_image)
steps:
# Check out the repo so that it can be tagged
- checkout: self
persistCredentials: true

# Create a tag in the code for this release
- task: Bash@3
displayName: Tag Code
inputs:
targetType: "inline"
script: |
git config user.name "BuildService"
git config user.email "builder@${COMPANY}.com"
git tag -a v${VERSION_NUMBER} -m "Release created by Azure DevOps"
git push origin v${VERSION_NUMBER}
env:
COMPANY: $(company)

# Create a GitHub release with these packages
- task: GitHubRelease@0
displayName: Create GitHub Release
inputs:
gitHubConnection: $(github_release_service_connection)
repositoryName: $(github_org)/$(self_repo)
tag: $(version_number)

0 comments on commit 2bfe3fe

Please sign in to comment.