cadet-cli/azure-pipelines.yml

119 строки
3.4 KiB
YAML

trigger:
branches:
include:
- master
phases:
- phase: Phase_1
displayName: Windows
condition: succeeded()
queue:
name: Hosted VS2017
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.x'
inputs:
versionSpec: 3.5
- script: |
pip3 install -r src/requirements.txt
displayName: install requirements
- script: |
python3 -m pylint src
pytest
displayName: lint and test
- script: |
cd package
pip3 install -r requirements.txt
pyinstaller --onefile ../src/cadet.py
displayName: package
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: GitHubRelease@0
displayName: 'GitHub release (create)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: bengreenier
repositoryName: 'microsoft/cadet-cli'
tagSource: manual
tag: 'v$(Build.SourceVersion)'
title: '$(Build.SourceVersion)'
releaseNotesSource: input
assets: 'package/dist/*'
isDraft: true
- phase: Phase_2
displayName: Linux (Ubuntu 1604)
dependsOn: Phase_1
condition: succeeded()
queue:
name: Hosted Ubuntu 1604
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.5'
inputs:
versionSpec: 3.5
- script: |
pip3 install --no-use-pep517 -r src/requirements.txt
displayName: install requirements
- script: |
python3 -m pylint src
pytest
displayName: lint and test
- script: 'sudo apt-get install -y python3-dev'
displayName: 'deps - apt-get'
- script: |
cd package
pip3 install -r requirements.txt
pyinstaller --onefile ../src/cadet.py
mv dist/cadet dist/cadet.linux
displayName: package
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: GitHubRelease@0
displayName: 'GitHub release (edit)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: bengreenier
repositoryName: 'microsoft/cadet-cli'
action: edit
tag: 'v$(Build.SourceVersion)'
title: '$(Build.SourceVersion)'
releaseNotesSource: input
assets: 'package/dist/*'
assetUploadMode: replace
isDraft: true
- phase: Phase_3
displayName: Mac
dependsOn: Phase_1
condition: succeeded()
queue:
name: Hosted macOS
steps:
- script: |
pip3 install -r src/requirements.txt
displayName: install requirements
- script: |
python3 -m pylint src
pytest
displayName: lint and test
- task: UsePythonVersion@0
displayName: 'Use Python 3.x'
inputs:
versionSpec: 3.5
- script: |
cd package
pip3 install -r requirements.txt
pyinstaller --onefile ../src/cadet.py
mv dist/cadet dist/cadet.mac
displayName: package
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: GitHubRelease@0
displayName: 'GitHub release (edit)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: bengreenier
repositoryName: 'microsoft/cadet-cli'
action: edit
tag: 'v$(Build.SourceVersion)'
title: '$(Build.SourceVersion)'
releaseNotesSource: input
assets: 'package/dist/*'
assetUploadMode: replace
isDraft: true