|
1 | | -# Starter pipeline |
2 | | -# Start with a minimal pipeline that you can customize to build and deploy your code. |
3 | | -# Add steps that build, run tests, deploy, and more: |
4 | | -# https://aka.ms/yaml |
5 | | - |
| 1 | +# Originally adapted from github.com/vispy/vispy (BSD 3-clause) |
6 | 2 | trigger: |
7 | | -- master |
8 | | - |
9 | | -pool: |
10 | | - vmImage: 'ubuntu-latest' |
11 | | - |
12 | | -steps: |
13 | | -- script: echo Hello, world! |
14 | | - displayName: 'Run a one-line script' |
15 | | - |
16 | | -- script: | |
17 | | - echo Add other tasks to build, test, and deploy your project. |
18 | | - echo See https://aka.ms/yaml |
19 | | - displayName: 'Run a multi-line script' |
| 3 | + branches: |
| 4 | + include: |
| 5 | + - '*' |
| 6 | + tags: |
| 7 | + include: |
| 8 | + - '*' |
| 9 | +variables: |
| 10 | + CIBW_BUILDING: "true" |
| 11 | + CIBW_SKIP: "cp27-* cp34-*" |
| 12 | + CIBW_TEST_COMMAND: "python -c \"import rtmixer; print(rtmixer.__version__)\"" |
| 13 | + CIBW_BUILD_VERBOSITY: "2" |
| 14 | + CIBW_BEFORE_BUILD: "pip install -U pip setuptools" |
| 15 | + CIBW_BEFORE_BUILD_LINUX: "yum install -y portaudio" |
| 16 | +jobs: |
| 17 | +- job: linux |
| 18 | + pool: {vmImage: 'Ubuntu-16.04'} |
| 19 | + steps: |
| 20 | + - task: UsePythonVersion@0 |
| 21 | + - bash: | |
| 22 | + git submodule update --init --recursive |
| 23 | + python -m pip install --upgrade pip |
| 24 | + pip install cibuildwheel twine numpy Cython jupyter ipywidgets |
| 25 | + python setup.py sdist -d wheelhouse |
| 26 | + cibuildwheel --output-dir wheelhouse . |
| 27 | + - task: PublishPipelineArtifact@1 |
| 28 | + inputs: |
| 29 | + path: $(System.DefaultWorkingDirectory)/wheelhouse |
| 30 | + artifact: deployLinux |
| 31 | +- job: macos |
| 32 | + pool: {vmImage: 'macOS-10.13'} |
| 33 | + steps: |
| 34 | + - task: UsePythonVersion@0 |
| 35 | + - bash: | |
| 36 | + git submodule update --init --recursive |
| 37 | + python -m pip install --upgrade pip |
| 38 | + pip install cibuildwheel |
| 39 | + cibuildwheel --output-dir wheelhouse . |
| 40 | + - task: PublishPipelineArtifact@1 |
| 41 | + inputs: |
| 42 | + path: $(System.DefaultWorkingDirectory)/wheelhouse |
| 43 | + artifact: deployMacOS |
| 44 | +- job: windows |
| 45 | + pool: {vmImage: 'vs2017-win2016'} |
| 46 | + steps: |
| 47 | + - {task: UsePythonVersion@0, inputs: {versionSpec: '3.5', architecture: x86}} |
| 48 | + - {task: UsePythonVersion@0, inputs: {versionSpec: '3.5', architecture: x64}} |
| 49 | + - {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x86}} |
| 50 | + - {task: UsePythonVersion@0, inputs: {versionSpec: '3.6', architecture: x64}} |
| 51 | + - {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x86}} |
| 52 | + - {task: UsePythonVersion@0, inputs: {versionSpec: '3.7', architecture: x64}} |
| 53 | + - bash: | |
| 54 | + git submodule update --init --recursive |
| 55 | + python -m pip install --upgrade pip |
| 56 | + pip install cibuildwheel |
| 57 | + cibuildwheel --output-dir wheelhouse . |
| 58 | + - task: PublishPipelineArtifact@1 |
| 59 | + inputs: |
| 60 | + path: $(System.DefaultWorkingDirectory)/wheelhouse |
| 61 | + artifact: deployWindows |
| 62 | +- job: deployPyPI |
| 63 | + pool: {vmImage: 'Ubuntu-16.04'} |
| 64 | + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) |
| 65 | + dependsOn: |
| 66 | + - linux |
| 67 | + - macos |
| 68 | + - windows |
| 69 | + steps: |
| 70 | + - task: UsePythonVersion@0 |
| 71 | + - task: DownloadPipelineArtifact@2 |
| 72 | + inputs: |
| 73 | + patterns: | |
| 74 | + deployLinux/* |
| 75 | + deployMacOS/*.whl |
| 76 | + deployWindows/*.whl |
| 77 | + - bash: | |
| 78 | + cd $(Pipeline.Workspace) |
| 79 | + python -m pip install --upgrade pip |
| 80 | + pip install twine |
| 81 | + twine upload -u "__token__" --skip-existing deployLinux/* deployMacOS/* deployWindows/* |
| 82 | + env: |
| 83 | + TWINE_PASSWORD: $(pypiToken) |
0 commit comments