From e7d34913c0a6e601531d2804ebef4a308de280ac Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 30 May 2019 17:35:47 +0200 Subject: [PATCH] Update azure-pipelines.yml for check version (#24194) --- azure-pipelines.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7a1e6e550d7..ce7def09821 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,7 +8,6 @@ trigger: tags: include: - '*' - variables: - name: versionBuilder value: '3.2' @@ -18,6 +17,7 @@ variables: - group: wheels - group: github + jobs: - job: 'Wheels' @@ -96,8 +96,30 @@ jobs: displayName: 'Run wheels build' -- job: 'Release' +- job: 'VersionValidate' condition: startsWith(variables['Build.SourceBranch'], 'refs/tags') + pool: + vmImage: 'ubuntu-latest' + steps: + - task: UsePythonVersion@0 + displayName: 'Use Python 3.7' + inputs: + versionSpec: '3.7' + - script: | + setup_version="$(python setup.py -V)" + branch_version="$(Build.SourceBranchName)" + + if [ "${setup_version}" != "${branch_version}" ]; then + echo "Version of tag ${branch_version} don't match with ${setup_version}!" + exit 1 + fi + displayName: 'Check version of branch/tag' + + +- job: 'Release' + condition: and(startsWith(variables['Build.SourceBranch'], 'refs/tags'), succeeded('VersionValidate') + dependsOn: + - 'VersionValidate' timeoutInMinutes: 120 pool: vmImage: 'ubuntu-16.04'