2019-01-02 03:59:41 +01:00
|
|
|
# https://aka.ms/yaml
|
2019-04-04 01:30:47 +02:00
|
|
|
trigger:
|
2019-04-04 02:19:20 +02:00
|
|
|
branches:
|
|
|
|
|
include:
|
|
|
|
|
- master
|
|
|
|
|
- staging
|
2019-04-04 20:33:57 +02:00
|
|
|
tags:
|
|
|
|
|
include:
|
2022-02-05 16:04:45 +01:00
|
|
|
- 'v*'
|
2019-04-04 01:30:47 +02:00
|
|
|
|
2019-01-02 03:59:41 +01:00
|
|
|
jobs:
|
2019-01-02 08:35:36 +01:00
|
|
|
- job: Build
|
2019-01-02 03:59:41 +01:00
|
|
|
pool:
|
2022-02-05 15:59:51 +01:00
|
|
|
vmImage: 'windows-2019' # other options: 'macOS-10.13', 'ubuntu-16.04'
|
2019-01-02 03:59:41 +01:00
|
|
|
strategy:
|
|
|
|
|
matrix:
|
2019-01-02 08:35:36 +01:00
|
|
|
cp36-cp36m-win_amd64.whl:
|
2019-01-02 05:45:28 +01:00
|
|
|
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'
|
2020-11-28 22:15:44 +01:00
|
|
|
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'
|
2024-03-19 00:53:55 +01:00
|
|
|
cp312-cp312-win_amd64.whl:
|
|
|
|
|
python.version: '3.12'
|
|
|
|
|
python.architecture: 'x64'
|
2024-11-12 20:47:19 +01:00
|
|
|
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'
|
2020-11-28 22:15:44 +01:00
|
|
|
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'
|
2024-03-19 00:53:55 +01:00
|
|
|
cp312-cp312-win32.whl:
|
|
|
|
|
python.version: '3.12'
|
|
|
|
|
python.architecture: 'x86'
|
2024-11-12 20:47:19 +01:00
|
|
|
cp313-cp313-win32.whl:
|
|
|
|
|
python.version: '3.13'
|
|
|
|
|
python.architecture: 'x86'
|
2019-01-02 05:50:18 +01:00
|
|
|
maxParallel: 6
|
2019-01-02 03:59:41 +01:00
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
|
inputs:
|
|
|
|
|
versionSpec: '$(python.version)'
|
2019-01-02 05:50:18 +01:00
|
|
|
architecture: '$(python.architecture)'
|
2019-01-02 03:59:41 +01:00
|
|
|
|
|
|
|
|
# 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
|
2022-05-16 20:10:27 +02:00
|
|
|
Invoke-WebRequest -Uri "https://www.klayout.org/downloads/klayout-microbits-4.0.zip" -OutFile klayout-microbits-4.0.zip
|
2019-01-02 03:59:41 +01:00
|
|
|
dir
|
2022-05-16 20:10:27 +02:00
|
|
|
Expand-Archive klayout-microbits-4.0.zip -DestinationPath klayout-microbits
|
2019-01-02 03:59:41 +01:00
|
|
|
dir klayout-microbits
|
|
|
|
|
#errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
|
|
|
|
|
#failOnStderr: false # Optional
|
|
|
|
|
#ignoreLASTEXITCODE: false # Optional
|
|
|
|
|
#pwsh: false # Optional
|
|
|
|
|
#workingDirectory: # Optional
|
2019-01-02 06:34:56 +01:00
|
|
|
displayName: 'Download and Extract KLayout bits'
|
2019-01-02 03:59:41 +01:00
|
|
|
|
2019-01-02 04:11:02 +01:00
|
|
|
- script: |
|
2019-01-02 05:50:18 +01:00
|
|
|
python -m pip install --upgrade pip setuptools wheel
|
2019-01-02 06:34:56 +01:00
|
|
|
displayName: 'Update pip, setuptools and wheel'
|
2019-01-02 04:11:02 +01:00
|
|
|
|
2019-01-02 03:59:41 +01:00
|
|
|
- script: |
|
|
|
|
|
python -V
|
2022-05-16 20:10:27 +02:00
|
|
|
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%
|
2019-01-02 06:34:56 +01:00
|
|
|
python setup.py bdist_wheel
|
2019-01-02 06:09:27 +01:00
|
|
|
displayName: 'Build KLayout'
|
|
|
|
|
|
2019-01-02 06:34:56 +01:00
|
|
|
- bash: |
|
2022-05-16 20:10:27 +02:00
|
|
|
bash `pwd`/ci-scripts/windows/fix_wheel.sh `pwd`/dist/*.whl "`pwd`/klayout-microbits/klayout-microbits-4.0/msvc2017/$PYTHON_ARCHITECTURE"
|
2019-01-02 06:34:56 +01:00
|
|
|
displayName: 'Copy klayout bits dlls into wheel'
|
|
|
|
|
|
2023-03-01 22:44:02 +01:00
|
|
|
- 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
|
2023-03-01 22:45:58 +01:00
|
|
|
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'
|
2019-04-03 05:08:37 +02:00
|
|
|
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
|
2024-11-13 14:10:00 +01:00
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.13.x64'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.13.x64'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
2024-03-19 18:24:31 +01:00
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.12.x64'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.12.x64'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
2022-12-24 21:54:16 +01:00
|
|
|
- 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)'
|
2020-11-28 22:15:44 +01:00
|
|
|
- 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)'
|
2024-11-13 14:10:00 +01:00
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.13.x86'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.13.x86'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
2024-03-19 18:24:31 +01:00
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.12.x86'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.12.x86'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
2022-12-24 21:54:16 +01:00
|
|
|
- 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)'
|
2020-11-28 22:15:44 +01:00
|
|
|
- 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'
|
2019-04-03 05:08:37 +02:00
|
|
|
- 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'
|
2019-04-04 02:27:38 +02:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
|
2019-01-02 08:35:36 +01:00
|
|
|
|