Skip to content

Commit

Permalink
Update azure-pipeline.yaml for Azure Pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusGeiger committed Feb 24, 2022
1 parent 38b4f25 commit 21f2687
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions azure-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ stages:
pool:
vmImage: ${{ parameters.vmImage }}
condition: and(succeeded(), ne(variables['Build.Reason'], 'IndividualCI'))
displayName: Sonar
dependsOn: Lint_Test
jobs:
- job:
displayName: Sonar prepare, analyze an publish
Expand All @@ -78,6 +78,7 @@ stages:
pool:
vmImage: ${{ parameters.vmImage }}
condition: and(succeeded(), ne(variables['Build.Reason'], 'IndividualCI'))
dependsOn: Sonar
displayName: Publish artifact
jobs:
- job:
Expand All @@ -91,36 +92,40 @@ stages:
- stage: Publish_on_PyPI
pool:
vmImage: ${{ parameters.vmImage }}
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
condition: and(eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(variables['Build.Reason'], 'IndividualCI'))
dependsOn: Publish_Artifact
displayName: Publish on PyPI
jobs:
- job:
variables:
- group: Python library variables
displayName: Publish on PyPI
steps:
- script: |
set -e
pip install poetry
#DEV
#poetry config http-basic.testpypi $(PYPI_JSM_USERNAME_TEST) $(PYPI_JSM_PASSWORD_TEST)
#poetry publish -r testpypi
#PROD
poetry build
poetry publish -u $(PYPI_JSM_USERNAME) -p $(PYPI_JSM_PASSWORD)
displayName: 'Publish on PyPI'
- script: |
set -e
set_variable(){
echo "Set key $1 as $2"
echo "##vso[task.setvariable variable=$1]$2"
}
LIB_VERSION=$(cat pyproject.toml | grep 'version' | head -1 | cut -d '"' -f 2)
set_variable "TAG_VERSION" ${LIB_VERSION}
displayName: 'Retrieve version from pyproject.toml'
- task: CmdLine@2
inputs:
script: |
set -e
pip install poetry
echo "poetry build >>>"
poetry build
echo "poetry publish >>>"
poetry publish -u $(PYPI_JSM_USERNAME) -p $(PYPI_JSM_PASSWORD)
- job:
displayName: 'Retrieve version from pyproject.toml'
steps:
- task: CmdLine@2
inputs:
script: |
set -e
set_variable(){
echo "Set key $1 as $2"
echo "##vso[task.setvariable variable=$1]$2"
}
LIB_VERSION=$(cat pyproject.toml | grep 'version' | head -1 | cut -d '"' -f 2)
set_variable "TAG_VERSION" ${LIB_VERSION}
- task: GitHubRelease@1
displayName: 'GitHub release (create)'
inputs:
Expand Down

0 comments on commit 21f2687

Please sign in to comment.