Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @OneIdentity/SafeguardPasswords
20 changes: 13 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,25 @@ variables:

trigger:
branches:
include: [ master, release-* ]
include: [ main, master, release-* ]
tags:
include: [ 'v*' ]
paths:
exclude:
- README.md
- AGENTS.md
- '**/*.md'
- LICENSE
- docs
- .github/CODEOWNERS

pr:
branches:
include: [ master, release-* ]
include: [ main, master, release-* ]
paths:
exclude:
- README.md
- AGENTS.md
- '**/*.md'
- LICENSE
- docs
- .github/CODEOWNERS

jobs:
# Job 1: PR Validation - runs only on pull requests
Expand Down Expand Up @@ -123,7 +129,7 @@ jobs:
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'release-$(version)'
tag: '$(ReleaseTag)'
title: '$(version)'
isPreRelease: $(isPrerelease)
changeLogCompareToRelease: 'lastFullRelease'
Expand Down
25 changes: 25 additions & 0 deletions pipeline-templates/build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ parameters:
default: false

steps:
- task: Bash@3
inputs:
targetType: 'inline'
script: |
TAG_NAME="$(Build.SourceBranchName)"
IS_TAG="$(isTagBuild)"

if [ "$IS_TAG" = "True" ]; then
if ! echo "$TAG_NAME" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "##[error]Tag '$TAG_NAME' does not match expected format v<major>.<minor>.<patch>"
exit 1
fi
VERSION="${TAG_NAME#v}"
RELEASE_TAG="$TAG_NAME"
echo "Tag build: version=$VERSION, releaseTag=$RELEASE_TAG"
else
VERSION="$(version)"
RELEASE_TAG="dev/v${VERSION}"
echo "Dev build: version=$VERSION, releaseTag=$RELEASE_TAG"
fi

echo "##vso[task.setvariable variable=version]$VERSION"
echo "##vso[task.setvariable variable=ReleaseTag]$RELEASE_TAG"
displayName: 'Derive version from tag or branch'

- task: Maven@4
inputs:
mavenPomFile: 'pom.xml'
Expand Down
13 changes: 9 additions & 4 deletions pipeline-templates/global-variables.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
variables:
- name: semanticVersion
value: '8.2.0'
- name: isTagBuild
value: ${{ startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}
- name: isPrerelease
value: 'true'
- name: versionSuffix
${{ if eq(variables.isPrerelease, 'true') }}:
value: '-SNAPSHOT'
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
value: 'false'
${{ else }}:
value: 'true'
- name: versionSuffix
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
value: ''
${{ else }}:
value: '-SNAPSHOT'