klayout/azure-pipelines.yml

248 lines
8.5 KiB
YAML
Raw Normal View History

# https://aka.ms/yaml
trigger:
2019-04-04 02:19:20 +02:00
branches:
include:
- master
- staging
tags:
include:
2022-02-05 16:04:45 +01:00
- 'v*'
jobs:
2019-01-02 08:35:36 +01:00
- job: Build
pool:
2022-02-05 15:59:51 +01:00
vmImage: 'windows-2019' # other options: 'macOS-10.13', 'ubuntu-16.04'
strategy:
matrix:
2019-01-02 08:35:36 +01:00
cp36-cp36m-win_amd64.whl:
python.version: '3.6'
2019-01-02 05:50:18 +01:00
python.architecture: 'x64'
2019-01-02 08:35:36 +01:00
cp37-cp37m-win_amd64.whl:
2019-01-02 05:47:47 +01:00
python.version: '3.7'
2019-01-02 05:50:18 +01:00
python.architecture: 'x64'
2020-09-08 22:26:00 +02:00
cp38-cp38-win_amd64.whl:
python.version: '3.8'
python.architecture: 'x64'
cp39-cp39-win_amd64.whl:
python.version: '3.9'
python.architecture: 'x64'
2022-02-05 15:59:51 +01:00
cp310-cp310-win_amd64.whl:
python.version: '3.10'
python.architecture: 'x64'
2022-12-24 15:36:13 +01:00
cp311-cp311-win_amd64.whl:
python.version: '3.11'
python.architecture: 'x64'
cp312-cp312-win_amd64.whl:
python.version: '3.12'
python.architecture: 'x64'
cp313-cp313-win_amd64.whl:
python.version: '3.13'
python.architecture: 'x64'
2019-01-02 08:35:36 +01:00
cp36-cp36m-win32.whl:
2019-01-02 05:50:18 +01:00
python.version: '3.6'
python.architecture: 'x86'
2019-01-02 08:35:36 +01:00
cp37-cp37m-win32.whl:
2019-01-02 05:50:18 +01:00
python.version: '3.7'
python.architecture: 'x86'
2020-09-08 22:26:00 +02:00
cp38-cp38-win32.whl:
python.version: '3.8'
python.architecture: 'x86'
cp39-cp39-win32.whl:
python.version: '3.9'
python.architecture: 'x86'
2022-02-05 15:59:51 +01:00
cp310-cp310-win32.whl:
python.version: '3.10'
python.architecture: 'x86'
2022-12-24 15:36:13 +01:00
cp311-cp311-win32.whl:
python.version: '3.11'
python.architecture: 'x86'
cp312-cp312-win32.whl:
python.version: '3.12'
python.architecture: 'x86'
cp313-cp313-win32.whl:
python.version: '3.13'
python.architecture: 'x86'
2019-01-02 05:50:18 +01:00
maxParallel: 6
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
2019-01-02 05:50:18 +01:00
architecture: '$(python.architecture)'
# Add additional tasks to run using each Python version in the matrix above
# PowerShell
# Run a PowerShell script on Windows, macOS, or Linux.
- task: PowerShell@2
inputs:
targetType: 'inline' # Optional. Options: filePath, inline
#arguments: # Optional
script: | # Required when targetType == Inline
pwd
Invoke-WebRequest -Uri "https://www.klayout.org/downloads/klayout-microbits-4.0.zip" -OutFile klayout-microbits-4.0.zip
dir
Expand-Archive klayout-microbits-4.0.zip -DestinationPath klayout-microbits
dir klayout-microbits
#errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
#failOnStderr: false # Optional
#ignoreLASTEXITCODE: false # Optional
#pwsh: false # Optional
#workingDirectory: # Optional
displayName: 'Download and Extract KLayout bits'
2019-01-02 04:11:02 +01:00
- script: |
# setuptools 67.0.0 is not working as of now (pypa/setuptools#4885)
python -m pip install --upgrade pip "setuptools<76.0.0" wheel
displayName: 'Update pip, setuptools and wheel'
2019-01-02 04:11:02 +01:00
- script: |
python -V
set "KLAYOUT_BITS=%cd%\klayout-microbits\klayout-microbits-4.0\msvc2017\%PYTHON_ARCHITECTURE%"
2019-01-02 05:50:18 +01:00
echo KLAYOUT_BITS=%KLAYOUT_BITS%
python setup.py bdist_wheel
2019-01-02 06:09:27 +01:00
displayName: 'Build KLayout'
- bash: |
bash `pwd`/ci-scripts/windows/fix_wheel.sh `pwd`/dist/*.whl "`pwd`/klayout-microbits/klayout-microbits-4.0/msvc2017/$PYTHON_ARCHITECTURE"
displayName: 'Copy klayout bits dlls into wheel'
- task: Bash@3
inputs:
targetType: 'inline'
script: |
set -e
echo $PATH
export TESTSRC=.
pip install klayout --no-index -f dist
python testdata/pymod/import_db.py
python testdata/pymod/import_rdb.py
python testdata/pymod/import_tl.py
python testdata/pymod/import_lib.py
python testdata/pymod/import_lay.py
python testdata/pymod/pya_tests.py
displayName: 'Test KLayout pymod'
2019-01-02 07:25:08 +01:00
- task: CopyFiles@2
condition: always()
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
targetFolder: '$(Build.ArtifactStagingDirectory)'
contents: '**/?(*.whl)'
- task: PublishBuildArtifacts@1
condition: always()
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
2019-01-02 07:53:42 +01:00
artifactName: 'wheel-$(python.version).$(python.architecture)'
2019-01-02 08:35:36 +01:00
- job: 'Deploy'
displayName: 'Combine Windows wheels and deploy to PyPI'
2019-01-02 08:35:36 +01:00
dependsOn: Build
pool:
2022-02-05 15:59:51 +01:00
vmImage: 'windows-2019' # other options: 'macOS-10.13', 'ubuntu-16.04'
2019-01-02 08:35:36 +01:00
steps:
- checkout: none #skip checking out the default repository resource
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.13.x64'
inputs:
artifactName: 'wheel-3.13.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.12.x64'
inputs:
artifactName: 'wheel-3.12.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.11.x64'
inputs:
artifactName: 'wheel-3.11.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
2022-02-05 15:59:51 +01:00
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.10.x64'
inputs:
artifactName: 'wheel-3.10.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.9.x64'
inputs:
artifactName: 'wheel-3.9.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
2020-09-08 22:26:00 +02:00
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.8.x64'
inputs:
artifactName: 'wheel-3.8.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
2019-01-02 08:35:36 +01:00
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.7.x64'
inputs:
artifactName: 'wheel-3.7.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.6.x64'
inputs:
artifactName: 'wheel-3.6.x64'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.13.x86'
inputs:
artifactName: 'wheel-3.13.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.12.x86'
inputs:
artifactName: 'wheel-3.12.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.11.x86'
inputs:
artifactName: 'wheel-3.11.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
2019-01-02 08:35:36 +01:00
- task: DownloadBuildArtifacts@0
2022-02-05 15:59:51 +01:00
displayName: 'Download Build Artifacts wheel-3.10.x86'
2019-01-02 08:35:36 +01:00
inputs:
2022-02-05 15:59:51 +01:00
artifactName: 'wheel-3.10.x86'
2019-01-02 08:35:36 +01:00
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.9.x86'
inputs:
artifactName: 'wheel-3.9.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
2020-09-08 22:26:00 +02:00
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.8.x86'
inputs:
artifactName: 'wheel-3.8.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
2019-01-02 08:35:36 +01:00
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.7.x86'
inputs:
artifactName: 'wheel-3.7.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts wheel-3.6.x86'
inputs:
artifactName: 'wheel-3.6.x86'
downloadPath: '$(System.DefaultWorkingDirectory)'
- task: CopyFiles@2
condition: always()
inputs:
sourceFolder: '$(System.DefaultWorkingDirectory)'
targetFolder: '$(Build.ArtifactStagingDirectory)'
contents: '**/?(*.whl)'
flattenFolders: true
- task: PublishBuildArtifacts@1
condition: always()
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'windows_wheels'
- bash: |
pip install -U twine
twine upload --skip-existing $BUILD_ARTIFACTSTAGINGDIRECTORY/*
env:
TWINE_USERNAME: $(TWINE_USERNAME)
TWINE_PASSWORD: $(TWINE_PASSWORD)
TWINE_REPOSITORY_URL: $(TWINE_REPOSITORY_URL)
displayName: 'Uploading to PyPI'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
2019-01-02 08:35:36 +01:00