44# https://docs.microsoft.com/azure/devops/pipelines/languages/python
55
66trigger :
7- - master
7+ - main
88
99pool :
1010 vmImage : ubuntu-latest
1111resources :
1212 repositories :
13- - repository : templates
14- type : github
15- name : CroudTech/devops-azure-pipelines-step-templates
16- ref : master
17- endpoint : CroudTech
18- - repository : self
13+ - repository : templates
14+ type : github
15+ name : CroudTech/devops-azure-pipelines-step-templates
16+ ref : master
17+ endpoint : CroudTech
18+ - repository : self
1919variables :
2020 - group : " package_managers"
2121 - name : python_version
2222 value : 3.8
2323jobs :
24+ - job : PythonTest
25+ steps :
26+ - template : test/python-test.yaml@templates
27+ parameters :
28+ coverage : app,core,status
29+ root_dir : ./
30+ python_version : 3.9
2431 - job : build
2532 displayName : Build
33+ dependsOn : PythonTest
34+ condition : and(succeeded(), in(variables['Build.SourceBranchName'], 'integration', 'main'))
2635 steps :
2736 - task : UsePythonVersion@0
2837 inputs :
@@ -34,18 +43,27 @@ jobs:
3443 versionSpec : 5.x
3544 - task : gitversion/execute@0
3645 displayName : Use GitVersion
37- - script : |
46+ - script : |
3847 pip install -r requirements.dev.txt
3948 python -m build
4049 python -m twine upload ./dist/* --non-interactive -u __token__ -p $(pypi_token)
4150 - job : GithubRelease
4251 dependsOn : build
4352 displayName : GithubRelease
4453 steps :
45- - template : release/github-release.yaml@templates
46- parameters :
47- semVer : $(semVer)
48- github_access_token : $(github_access_token)
49- github_org : CroudTech
50- github_repo : croudtech-python-bootstrap-app
51-
54+ - task : UsePythonVersion@0
55+ inputs :
56+ versionSpec : " 3.8"
57+ addToPath : true
58+ architecture : " x64"
59+ - script : |
60+ pip install -r requirements.dev.txt
61+ pip install pyinstaller
62+ pyinstaller --onefile ./croudtech_bootstrap_app/croudtech-bootstrap.py --clean
63+ cp ./dist/croudtech-bootstrap $(Build.ArtifactStagingDirectory)/croudtech-bootstrap
64+ - template : release/github-release.yaml@templates
65+ parameters :
66+ semVer : $(semVer)
67+ github_access_token : $(github_access_token)
68+ github_org : CroudTech
69+ github_repo : croudtech-python-bootstrap-app
0 commit comments