Skip to content

Commit

Permalink
azure-pipeline.yml: change variable for main branch
Browse files Browse the repository at this point in the history
Eliminate the trigger for master branch and also change the
conditional variable for publish artifacts step.

Signed-off-by: Andreea Andrisan <[email protected]>
  • Loading branch information
AAndrisa committed Jan 12, 2024
1 parent eac9d4c commit 4efb12b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
variables:
libiioPipelineId: 9
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]

${{ if eq(variables['Build.SourceBranchName'], 'libad9361-iio-v0') }}:
downloadBranch: 'refs/heads/libiio-v0'
${{ elseif eq(variables['Build.SourceBranchName'], 'next_stable') }}:
downloadBranch: 'refs/heads/next_stable'
${{ elseif eq(variables['Build.Reason'], 'PullRequest') }}:
downloadBranch: $[ format('refs/heads/{0}',replace(replace(variables['System.PullRequest.TargetBranch'], 'libad9361-iio-v0', 'libiio-v0'), 'master', 'main')) ]
downloadBranch: $[ format('refs/heads/{0}',replace(variables['System.PullRequest.TargetBranch'], 'libad9361-iio-v0', 'libiio-v0')) ]
${{ else }}:
downloadBranch: 'refs/heads/main'

trigger:
branches:
include:
- main
- master
- next_stable
- libad9361-iio-v0
- staging/*
Expand All @@ -27,7 +27,6 @@ pr:
branches:
include:
- main
- master
- next_stable
- libad9361-iio-v0
- 20*
Expand Down Expand Up @@ -90,7 +89,7 @@ jobs:
artifactFeed: libad9361-iio
pythonUploadServiceConnection: PyPi
- task: TwineAuthenticate@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['artifactName'], 'Linux-Ubuntu-20.04'))
condition: and(succeeded(), variables.isMain, eq(variables['artifactName'], 'Linux-Ubuntu-20.04'))
displayName: Twine Authenticate
inputs:
artifactFeed: test-libad9361-iio
Expand All @@ -110,12 +109,12 @@ jobs:
ls -al
cd dist
ls -al
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['artifactName'], 'Linux-Ubuntu-20.04'))
condition: and(succeeded(), variables.isMain, eq(variables['artifactName'], 'Linux-Ubuntu-20.04'))
displayName: "Update to dev version"
- script: |
cd /home/vsts/work/1/s/build/bindings/python
sudo python -m twine upload --repository-url https://test.pypi.org/legacy/ -u $(USERNAME) -p $(PASSWORD) --skip-existing --config-file $(PYPIRC_PATH) dist/*.whl
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['artifactName'], 'Linux-Ubuntu-20.04'))
condition: and(succeeded(), variables.isMain, eq(variables['artifactName'], 'Linux-Ubuntu-20.04'))
displayName: "Deploy python test package"
- job: ARMBuilds
Expand Down

0 comments on commit 4efb12b

Please sign in to comment.