Skip to content

Commit

Permalink
revamping ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Aug 9, 2019
1 parent 4c36d86 commit f031041
Showing 1 changed file with 42 additions and 49 deletions.
91 changes: 42 additions & 49 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,29 @@ pr:

jobs:

# LINT AND FORMATTING CODE
- job: 'Lint'
dependsOn: 'Test'
pool:
vmImage: "windows-2019"

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
architecture: 'x64'
addToPath: true

- script: |
python -m pip install -U pip
python -m pip install -U black
displayName: 'Install black dependencies'
- script: |
python -m black --target-version=py37 .\isogeo_pysdk
python -m black --target-version=py37 .\tests
displayName: 'Apply black code formatting'
# UNIT TESTS
- job: 'Test'
pool:
Expand Down Expand Up @@ -91,35 +114,24 @@ jobs:
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'


# LINT AND FORMATTING CODE
- job: 'Lint'
dependsOn: 'Test'
# BUILD and PUBLISH
# only with a tagged commit (see: https://github.com/MicrosoftDocs/vsts-docs/issues/3281)
- job: 'Publish'
dependsOn: 'Lint'
pool:
vmImage: "windows-2019"
# condition:
# contains(variables['Build.SourceBranch'], 'tags')

steps:
- task: UsePythonVersion@0
- task: GitHubRelease@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
addToPath: true

- script: |
python -m pip install -U pip
python -m pip install -U black
displayName: 'Install black dependencies'
- script: python -m black --target-version=py36 .\isogeo_pysdk
displayName: 'Apply black code formatting'

# BUILD
- job: 'Build'
dependsOn: 'Lint'
pool:
vmImage: "windows-2019"
gitHubConnection: 'Azure DevOps'
repositoryName: 'isogeo/isogeo-api-py-minsdk'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'auto'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
Expand All @@ -141,36 +153,17 @@ jobs:
- script: python setup.py bdist_wheel
displayName: 'Build wheel'


# PUBLISH
# only with a tagged commit (see: https://github.com/MicrosoftDocs/vsts-docs/issues/3281)
- job: 'Publish'
dependsOn: 'Build'
pool:
vmImage: "windows-2019"
condition:
contains(variables['Build.SourceBranch'], 'tags')

steps:
- task: GitHubRelease@0
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact: Isogeo Python SDK package'
inputs:
gitHubConnection: 'Azure DevOps'
repositoryName: 'isogeo/isogeo-api-py-minsdk'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'auto'

- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
architecture: 'x64'
addToPath: true

- script: 'python -m pip install -U twine'
path: $(System.DefaultWorkingDirectory)/dist
artifact: 'IsogeoPythonSDK_$(Build.SourceVersion)'

- task: TwineAuthenticate@0
# see: https://dev.azure.com/isogeo/Python%20SDK/_settings/adminservices?resourceId=7650b333-6c8a-4c56-a839-a33242255c16&resource=%5Bobject%20Object%5D&_a=resources
inputs:
externalFeeds: 'Python Package Index (PyPi)' # see: https://dev.azure.com/isogeo/Python%20SDK/_settings/adminservices?resourceId=7650b333-6c8a-4c56-a839-a33242255c16&resource=%5Bobject%20Object%5D&_a=resources
externalFeeds: 'Python Package Index (PyPi)'

- script: twine upload dist/* -r 'Python Package Index (PyPi)' -u $(TWINE_USERNAME) -p $(TWINE_PASSWORD)
continueOnError: true
displayName: "Upload to PyPi"

0 comments on commit f031041

Please sign in to comment.