diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c9f4e82a4..b8bcf8c18 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -70,6 +70,9 @@ stages: persistCredentials: true - script: | set -e + if echo $(Build.SourceBranch) | grep -q '^refs/tags/v'; then + export IS_RELEASE=1 + fi mkdir build && cd build if [ "$ARTIFACTNAME" != "Linux-CentOS-7" ]; then cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON -DCPP_BINDINGS=ON -DWITH_DOC=ON -DWITH_SERIAL_BACKEND=ON -DWITH_MAN=ON -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} @@ -328,6 +331,9 @@ stages: condition: ne(variables['agentName'],'miniMAC_arm64') - script: | set -e + if echo $(Build.SourceBranch) | grep -q '^refs/tags/v'; then + export IS_RELEASE=1 + fi mkdir build && cd build cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=ON -DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '/python')") -DPYTHON_BINDINGS=ON -DWITH_EXAMPLES=ON -DWITH_SERIAL_BACKEND=ON make @@ -336,6 +342,9 @@ stages: displayName: 'Build' - script: | set -e + if echo $(Build.SourceBranch) | grep -q '^refs/tags/v'; then + export IS_RELEASE=1 + fi mkdir build_tar && cd build_tar cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON -DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '/python')") -DPYTHON_BINDINGS=ON -DWITH_SERIAL_BACKEND=ON -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} make @@ -347,6 +356,9 @@ stages: displayName: 'Build tar' - script: | set -e + if echo $(Build.SourceBranch) | grep -q '^refs/tags/v'; then + export IS_RELEASE=1 + fi cd build cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_SERIAL_BACKEND=ON make @@ -416,7 +428,10 @@ stages: displayName: 'Setup' - script: | set -e - sudo docker run --platform "linux/$(arch)" --rm -t --privileged -e ARTIFACTNAME=$(artifactName) -v "$(Agent.BuildDirectory)/s":"/ci" -v "/usr/bin/qemu-$(arch)-static":"/usr/bin/qemu-$(arch)-static" "$(image)" /bin/bash -c "cd /ci/ && chmod +x ./CI/azure/$(build_script) && ./CI/azure/$(build_script)" + if echo $(Build.SourceBranch) | grep -q '^refs/tags/v'; then + release_build=1 + fi + sudo docker run --platform "linux/$(arch)" --rm -t --privileged -e IS_RELEASE={release_build} -e ARTIFACTNAME=$(artifactName) -v "$(Agent.BuildDirectory)/s":"/ci" -v "/usr/bin/qemu-$(arch)-static":"/usr/bin/qemu-$(arch)-static" "$(image)" /bin/bash -c "cd /ci/ && chmod +x ./CI/azure/$(build_script) && ./CI/azure/$(build_script)" displayName: 'Build' - task: CopyFiles@2 inputs: @@ -453,6 +468,9 @@ stages: clean: true - script: | set -e + if echo $(Build.SourceBranch) | grep -q '^refs/tags/v'; then + export IS_RELEASE=1 + fi mkdir build && cd build cmake .. mkdir artifacts