forked from NewFuture/DDNS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
132 lines (108 loc) · 3.36 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
batch: true
branches:
include:
- 'master'
- 'fix*'
- 'feat*'
- 'dev*'
tags:
include:
- "v*"
- "V*"
pr:
autoCancel: true
branches:
include:
- master
jobs:
- job: 'Windows'
pool:
vmImage: 'windows-latest'
strategy:
matrix:
Python27:
python.version: '2.7'
pyinstaller.version: 'pyinstaller==3.6'
Python37:
python.version: '3.7'
pyinstaller.version: 'pyinstaller'
maxParallel: 4
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip
displayName: 'Install dependencies'
- script: pip install $(pyinstaller.version)
name: 'pyinstaller'
- bash: sed -i -e "s/\${BUILD_SOURCEBRANCHNAME}/${BUILD_SOURCEBRANCHNAME}/" -e "s/\${BUILD_DATE}/$(date --iso-8601=seconds)/" run.py
name: 'replaceBuild'
- script: pyinstaller --onefile --noconfirm --clean ./.build/ddns.spec
name: 'build'
- bash: dist/ddns.exe || test -e "config.json"
name: run
- script: copy .release\\*.bat dist
name: 'CopyRlease'
- bash: envsubst < .release/README.md > dist/README.md
name: ReplaceVersion
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: './dist/'
artifactName: 'ddns-win-$(python.version)'
- job: 'MacOS'
pool:
vmImage: 'macos-latest'
strategy:
matrix:
Python27:
python.version: '2.7'
pyinstaller.version: 'pyinstaller==3.6'
Python37:
python.version: '3.7'
pyinstaller.version: 'pyinstaller'
maxParallel: 4
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip
displayName: 'Install dependencies'
- script: pip install $(pyinstaller.version)
name: 'pyinstaller'
- bash: sed -i.temp -e "s/\${BUILD_SOURCEBRANCHNAME}/${BUILD_SOURCEBRANCHNAME}/" -e "s/\${BUILD_DATE}/$(date --iso-8601=seconds)/" run.py
name: 'replaceBuild'
- script: pyinstaller --onefile --noconfirm --clean ./.build/ddns.spec
name: 'build'
- script: ./dist/ddns || test -e "config.json"
name: 'test'
- script: cp dist/ddns dist/ddns-osx
name: 'CopyDist'
- script: cp .release/*.sh dist/ && cp .release/*.md dist/
name: 'CopyRlease'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: './dist/'
artifactName: 'ddns-mac-$(python.version)'
# release
# steps:
# - task: GitHubRelease@0
# displayName: 'GitHub release (edit)'
# inputs:
# gitHubConnection: 'github connection'
# repositoryName: NewFuture/DDNS
# action: edit
# tag: '$(Build.SourceBranchName)'
# releaseNotesFile: '$(System.DefaultWorkingDirectory)/DDNS/ddns-win-3.7/README.md'
# assets: |
# $(System.DefaultWorkingDirectory)/DDNS/ddns-win-3.7/*.exe
# $(System.DefaultWorkingDirectory)/DDNS/ddns-win-3.7/*.bat
# $(System.DefaultWorkingDirectory)/DDNS/ddns-mac-3.7/ddns-osx
# $(System.DefaultWorkingDirectory)/DDNS/ddns-mac-3.7/*.sh
# assetUploadMode: replace