-
Notifications
You must be signed in to change notification settings - Fork 16
/
azure-pipelines.yml
126 lines (115 loc) · 4.09 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
trigger:
branches:
include:
- '*'
tags:
include:
- v*
jobs:
- job: Build
strategy:
maxParallel: 4
matrix:
LinuxWheels:
imageName: 'ubuntu-latest'
artifactName: linuxwheels
CFLAGS: "-std=c++14"
CIBW_BEFORE_TEST: pip install -r {project}/test_requirements.txt && pip uninstall -y pyxpdf_data
MacWheels:
imageName: 'macOS-10.15'
artifactName: macwheels
CFLAGS: "-std=c++14"
CIBW_BEFORE_TEST: pip install -r {project}/test_requirements.txt && pip uninstall -y pyxpdf_data
WinWheels:
imageName: 'windows-latest'
artifactName: winwheels
CIBW_BEFORE_BUILD_WINDOWS: pip install -r {project}\requirements.txt && rmdir /S /Q libs || echo "No libs"
CIBW_BEFORE_TEST: pip install -r {project}\test_requirements.txt && pip uninstall -y pyxpdf_data
pool: { vmImage: $(imageName) }
variables:
WITH_CYTHON: true
CIBW_TEST_COMMAND: "python {project}/runtests.py -v"
CIBW_SKIP: "?p27* pp*"
CIBW_BUILD_VERBOSITY: 1
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
displayName: "Python Setup"
- bash: |
brew postinstall openssl
export SSL_CERT_FILE=$(brew --prefix)/etc/openssl/cert.pem
echo "##vso[task.setvariable variable=SSL_CERT_FILE]$SSL_CERT_FILE"
displayName: "Update SSL Certs"
condition: contains(variables['imageName'], 'macOS')
- bash: |
python -m pip install --upgrade pip setuptools wheel
pip install -r test_requirements.txt
python setup.py build_ext -i -vv --warnings
python runtests.py -vv || exit 1
make clean
displayName: "Initial Build Tests"
- bash: |
pip install cibuildwheel==1.4.1
cibuildwheel --output-dir wheelhouse .
displayName: "Build Wheels"
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: 'wheelhouse'
ArtifactName: $(artifactName)
displayName: "Create Artifacts"
- deployment: publishWheels
displayName: Make Release
dependsOn: Build
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
environment: 'pyxpdf-dev'
strategy:
runOnce:
deploy:
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
displayName: "Python Setup"
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'specific'
downloadPath: 'wheelhouse'
- bash: |
SDIST_FOLDER=wheelhouse/sdist
mkdir -p $SDIST_FOLDER
python3 -m pip install -U setuptools pip twine wheel
python3 setup.py sdist -d $SDIST_FOLDER
pushd $SDIST_FOLDER
python3 -m pip install pyxpdf* -v
python3 ../runtests.py
popd
displayName: Build & Test sdist
- bash: |
ls -lh wheelhouse
ls -lh wheelhouse/**/*
echo TWINE_USERNAME=$TWINE_USERNAME
python3 -m twine check wheelhouse/**/* || exit 1
python3 -m twine upload --non-interactive --skip-existing wheelhouse/**/*
displayName: Upload to PyPi
env:
TWINE_USERNAME: $(pypi_username)
TWINE_PASSWORD: $(pypi_token)
- task: GitHubRelease@1
inputs:
gitHubConnection: 'github.com_ashutoshvarma'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'gitTag'
tagPattern: 'v.+'
releaseNotesSource: 'inline'
releaseNotesInline: 'Changelog - https://pyxpdf.readthedocs.io/en/latest/changelog.html'
assets: 'wheelhouse/**/*'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'
displayName: Make Github Release