Skip to content

Commit

Permalink
azure-pipelines.yml: integrate IS_RELEASE variable
Browse files Browse the repository at this point in the history
In case the build was triggered for a release purpose we don't want to
use the git sha in the version of libiio.

The new variable will be used in order to identify that is a build
dedicated to a release.

Signed-off-by: Andreea Andrisan <Andreea.Andrisan@analog.com>
  • Loading branch information
AAndrisa committed Aug 1, 2024
1 parent c6d322a commit 76f2947
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 76f2947

Please sign in to comment.