mirror of
https://github.com/Z3Prover/z3
synced 2025-09-03 08:38:06 +00:00
Script assembly signing & NuGet package creation in Azure Pipelines (#2862)
Windows x86/x64 builds now parallelized Windows assemblies now signed NuGet package created NuGet package signed NuGet package published to NuGet.org
This commit is contained in:
parent
dc5d8819cd
commit
ea3b149575
12 changed files with 496 additions and 440 deletions
|
@ -1,141 +1,321 @@
|
|||
jobs:
|
||||
# Release pipeline (must be triggered manually)
|
||||
# * Builds for all platforms (with code signing)
|
||||
# * Creates packages for Python and NuGet
|
||||
# * Uploads build products to stores (GitHub, NuGet, PyPI)
|
||||
|
||||
- job: Mac
|
||||
displayName: "Mac Build"
|
||||
pool:
|
||||
vmImage: "macOS-10.14"
|
||||
steps:
|
||||
- script: python scripts/mk_unix_dist.py --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
- script: python z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
- script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/.
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Mac'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
trigger: none
|
||||
|
||||
- job: Ubuntu
|
||||
displayName: "Ubuntu build"
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
steps:
|
||||
- script: python scripts/mk_unix_dist.py --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
- script: python z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
- script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/.
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Ubuntu'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
variables:
|
||||
ReleaseVersion: '4.8.8'
|
||||
|
||||
- job: Manylinux
|
||||
displayName: "Manylinux build"
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
container: "rhelmot/manylinux1_x86_64:latest"
|
||||
variables:
|
||||
python: "/opt/python/cp35-cp35m/bin/python"
|
||||
steps:
|
||||
- script: $(python) scripts/mk_unix_dist.py --nodotnet --nojava
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
- script: $(python) z3test/scripts/test_benchmarks.py build-dist/z3 z3test/regressions/smt2
|
||||
- script: cp dist/*.zip $(Build.ArtifactStagingDirectory)/
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Manylinux'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
stages:
|
||||
|
||||
- job: Windows
|
||||
displayName: "Windows build"
|
||||
pool:
|
||||
vmImage: "vs2017-win2016"
|
||||
steps:
|
||||
- script: scripts\mk_win_dist.cmd
|
||||
- script: xcopy dist\*.zip $(Build.ArtifactStagingDirectory)\* /y
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Windows'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
# Builds Z3 on various platforms
|
||||
- stage: Build
|
||||
jobs:
|
||||
|
||||
- job: MacBuild
|
||||
displayName: "macOS Build"
|
||||
pool:
|
||||
vmImage: "macOS-10.14"
|
||||
steps:
|
||||
- task: PythonScript@0
|
||||
displayName: Build
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: scripts/mk_unix_dist.py
|
||||
arguments: --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
displayName: 'Clone z3test'
|
||||
- task: PythonScript@0
|
||||
displayName: Test
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: z3test/scripts/test_benchmarks.py
|
||||
arguments: build-dist/z3 z3test/regressions/smt2
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'macOSBuild'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: Python
|
||||
displayName: "Python packaging"
|
||||
dependsOn:
|
||||
- Manylinux
|
||||
- Windows
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Windows'
|
||||
targetPath: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Manylinux'
|
||||
targetPath: $(Agent.TempDirectory)
|
||||
- script: cd $(Agent.TempDirectory); mkdir linux-bin; cd linux-bin; unzip ../*centos*.zip
|
||||
- script: cd $(Agent.TempDirectory); mkdir win32-bin; cd win32-bin; unzip ../*x86-win*.zip
|
||||
- script: cd $(Agent.TempDirectory); mkdir win64-bin; cd win64-bin; unzip ../*x64-win*.zip
|
||||
- script: python -m pip install --user -U setuptools wheel
|
||||
- script: cd src/api/python; python setup.py sdist
|
||||
# take a look at this PREMIUM HACK I came up with to get around the fact that the azure variable syntax overloads the bash syntax for subshells
|
||||
- script: cd src/api/python; echo $(Agent.TempDirectory)/linux-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python setup.py bdist_wheel
|
||||
- script: cd src/api/python; echo $(Agent.TempDirectory)/win32-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python setup.py bdist_wheel
|
||||
- script: cd src/api/python; echo $(Agent.TempDirectory)/win64-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python setup.py bdist_wheel
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Python packages'
|
||||
targetPath: src/api/python/dist
|
||||
- job: UbuntuBuild
|
||||
displayName: "Ubuntu build"
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
steps:
|
||||
- task: PythonScript@0
|
||||
displayName: Build
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: scripts/mk_unix_dist.py
|
||||
arguments: --dotnet-key=$(Build.SourcesDirectory)/resources/z3.snk
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
displayName: 'Clone z3test'
|
||||
- task: PythonScript@0
|
||||
displayName: Test
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: z3test/scripts/test_benchmarks.py
|
||||
arguments: build-dist/z3 z3test/regressions/smt2
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'UbuntuBuild'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- job: Deploy
|
||||
displayName: "Deploy into GitHub and PyPI"
|
||||
dependsOn:
|
||||
- Mac
|
||||
- Ubuntu
|
||||
- Windows
|
||||
- Python
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Windows'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Mac'
|
||||
targetPath: tmp
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Ubuntu'
|
||||
targetPath: tmp
|
||||
# TBD: build NuGet package
|
||||
# TBD: this script should build a specific pre-specified tag
|
||||
- task: GitHubRelease@0
|
||||
inputs:
|
||||
gitHubConnection: Z3GitHub
|
||||
repositoryName: 'Z3Prover/z3'
|
||||
action: 'create'
|
||||
target: '$(Build.SourceVersion)'
|
||||
tagSource: 'manual'
|
||||
tag: 'z3-4.8.7'
|
||||
title: 'z3-4.8.7'
|
||||
releaseNotesSource: 'input'
|
||||
releaseNotes: '4.8.7 release'
|
||||
assets: 'tmp/*'
|
||||
isDraft: true
|
||||
isPreRelease: true
|
||||
- task: DownloadPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'Python packages'
|
||||
targetPath: dist
|
||||
- task: DownloadSecureFile@1
|
||||
name: pypirc
|
||||
inputs:
|
||||
secureFile: 'pypirc'
|
||||
- script: pip install --upgrade pip
|
||||
- script: python -m pip install --user -U setuptools importlib_metadata wheel twine
|
||||
# Uncomment on release:
|
||||
- script: python -m twine upload --config-file $(pypirc.secureFilePath) -r $(pypiReleaseServer) dist/*
|
||||
- job: ManyLinuxBuild
|
||||
displayName: "ManyLinux build"
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
container: "rhelmot/manylinux1_x86_64:latest"
|
||||
variables:
|
||||
python: "/opt/python/cp35-cp35m/bin/python"
|
||||
steps:
|
||||
- task: PythonScript@0
|
||||
displayName: Build
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: scripts/mk_unix_dist.py
|
||||
arguments: --nodotnet --nojava
|
||||
pythonInterpreter: $(python)
|
||||
- script: git clone https://github.com/z3prover/z3test z3test
|
||||
displayName: 'Clone z3test'
|
||||
- task: PythonScript@0
|
||||
displayName: Test
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: z3test/scripts/test_benchmarks.py
|
||||
arguments: build-dist/z3 z3test/regressions/smt2
|
||||
pythonInterpreter: $(python)
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: dist
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'ManyLinuxBuild'
|
||||
targetPath: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- template: build-win-signed.yml
|
||||
parameters:
|
||||
ReleaseVersion: $(ReleaseVersion)
|
||||
BuildArchitecture: 'x64'
|
||||
|
||||
- template: build-win-signed.yml
|
||||
parameters:
|
||||
ReleaseVersion: $(ReleaseVersion)
|
||||
BuildArchitecture: 'x86'
|
||||
|
||||
# TBD: run regression tests on generated binaries.
|
||||
# Creates Z3 packages in various formats
|
||||
- stage: Package
|
||||
jobs:
|
||||
|
||||
- job: NuGetPackage
|
||||
displayName: "NuGet packaging"
|
||||
pool:
|
||||
vmImage: "windows-latest"
|
||||
steps:
|
||||
- powershell: write-host $(System.DefinitionId)
|
||||
displayName: 'System.DefinitionId'
|
||||
- powershell: write-host $(Build.BuildId)
|
||||
displayName: 'Build.BuildId'
|
||||
- powershell: write-host $(System.TeamProjectId)
|
||||
displayName: 'System.TeamProjectId'
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Win64 Build'
|
||||
inputs:
|
||||
artifact: 'WindowsBuild-x64'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Ubuntu Build'
|
||||
inputs:
|
||||
artifact: 'UbuntuBuild'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download macOS Build'
|
||||
inputs:
|
||||
artifact: 'macOSBuild'
|
||||
path: $(Agent.TempDirectory)\package
|
||||
- task: PythonScript@0
|
||||
displayName: 'Python: assemble files'
|
||||
inputs:
|
||||
scriptSource: 'filepath'
|
||||
scriptPath: scripts\mk_nuget_task.py
|
||||
workingDirectory: $(Agent.TempDirectory)\package
|
||||
arguments:
|
||||
$(Agent.TempDirectory)\package
|
||||
$(ReleaseVersion)
|
||||
$(Build.Repository.Uri)
|
||||
$(Build.SourceBranchName)
|
||||
$(Build.SourceVersion)
|
||||
$(Build.SourcesDirectory)
|
||||
- task: NuGetToolInstaller@0
|
||||
inputs:
|
||||
versionSpec: 5.x
|
||||
checkLatest: false
|
||||
- task: NugetCommand@2
|
||||
displayName: 'NuGet Pack'
|
||||
inputs:
|
||||
command: pack
|
||||
packagesToPack: $(Agent.TempDirectory)\package\out\Microsoft.Z3.x64.nuspec
|
||||
basePath: $(Agent.TempDirectory)\package\out
|
||||
packDestination: $(Build.ArtifactStagingDirectory)
|
||||
verbosityPack: detailed
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: 'Sign Package'
|
||||
inputs:
|
||||
ConnectedServiceName: 'z3-esrp-signing'
|
||||
FolderPath: $(Build.ArtifactStagingDirectory)
|
||||
Pattern: Microsoft.Z3.x64.$(ReleaseVersion).nupkg
|
||||
signConfigType: 'inlineSignParams'
|
||||
inlineOperation: |
|
||||
[
|
||||
{
|
||||
"KeyCode" : "CP-401405",
|
||||
"OperationCode" : "NuGetSign",
|
||||
"Parameters" : {},
|
||||
"ToolName" : "sign",
|
||||
"ToolVersion" : "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode" : "CP-401405",
|
||||
"OperationCode" : "NuGetVerify",
|
||||
"Parameters" : {},
|
||||
"ToolName" : "sign",
|
||||
"ToolVersion" : "1.0"
|
||||
}
|
||||
]
|
||||
SessionTimeout: '60'
|
||||
MaxConcurrency: '50'
|
||||
MaxRetryAttempts: '5'
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
targetPath: $(Build.ArtifactStagingDirectory)\Microsoft.Z3.x64.$(ReleaseVersion).nupkg
|
||||
artifactName: 'NuGetPackage'
|
||||
|
||||
- job: PythonPackage
|
||||
displayName: "Python packaging"
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download macOS Build'
|
||||
inputs:
|
||||
artifact: 'macOSBuild'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download ManyLinux Build'
|
||||
inputs:
|
||||
artifact: 'ManyLinuxBuild'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Win32 Build'
|
||||
inputs:
|
||||
artifact: 'WindowsBuild-x86'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Win64 Build'
|
||||
inputs:
|
||||
artifact: 'WindowsBuild-x64'
|
||||
path: $(Agent.TempDirectory)
|
||||
- script: cd $(Agent.TempDirectory); mkdir osx-bin; cd osx-bin; unzip ../*osx*.zip
|
||||
- script: cd $(Agent.TempDirectory); mkdir linux-bin; cd linux-bin; unzip ../*centos*.zip
|
||||
- script: cd $(Agent.TempDirectory); mkdir win32-bin; cd win32-bin; unzip ../*x86-win*.zip
|
||||
- script: cd $(Agent.TempDirectory); mkdir win64-bin; cd win64-bin; unzip ../*x64-win*.zip
|
||||
- script: python -m pip install --user -U setuptools wheel
|
||||
- script: cd src/api/python; python setup.py sdist
|
||||
# take a look at this PREMIUM HACK I came up with to get around the fact that the azure variable syntax overloads the bash syntax for subshells
|
||||
- script: cd src/api/python; echo $(Agent.TempDirectory)/osx-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python setup.py bdist_wheel
|
||||
- script: cd src/api/python; echo $(Agent.TempDirectory)/linux-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python setup.py bdist_wheel
|
||||
- script: cd src/api/python; echo $(Agent.TempDirectory)/win32-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python setup.py bdist_wheel
|
||||
- script: cd src/api/python; echo $(Agent.TempDirectory)/win64-bin/* | xargs printf 'PACKAGE_FROM_RELEASE=%s\n' | xargs -I '{}' env '{}' python setup.py bdist_wheel
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'PythonPackage'
|
||||
targetPath: src/api/python/dist
|
||||
|
||||
# Uploads Z3 packages to various package stores
|
||||
- stage: Publish
|
||||
jobs:
|
||||
|
||||
- job: GitHubPublish
|
||||
displayName: "Publish to GitHub"
|
||||
pool:
|
||||
vmImage: "windows-latest"
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download macOS Build'
|
||||
inputs:
|
||||
artifact: 'macOSBuild'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Win32 Build'
|
||||
inputs:
|
||||
artifact: 'WindowsBuild-x86'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download Win64 Build'
|
||||
inputs:
|
||||
artifact: 'WindowsBuild-x64'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: GitHubRelease@0
|
||||
inputs:
|
||||
gitHubConnection: Z3GitHub
|
||||
repositoryName: $(Build.Repository.Name)
|
||||
action: 'create'
|
||||
target: '$(Build.SourceVersion)'
|
||||
tagSource: 'manual'
|
||||
tag: 'z3-$(ReleaseVersion)'
|
||||
title: 'z3-$(ReleaseVersion)'
|
||||
releaseNotesSource: 'input'
|
||||
releaseNotes: '$(ReleaseVersion) release'
|
||||
assets: '$(Agent.TempDirectory)/*.zip'
|
||||
isDraft: true
|
||||
isPreRelease: false
|
||||
|
||||
- job: NuGetPublish
|
||||
displayName: "Publish to NuGet.org"
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: 'Download NuGet Package'
|
||||
inputs:
|
||||
artifact: 'NuGetPackage'
|
||||
path: $(Agent.TempDirectory)
|
||||
- task: NuGetAuthenticate@0
|
||||
inputs:
|
||||
nuGetServiceConnections: Z3Nuget
|
||||
# - task: NuGetCommand@2
|
||||
# inputs:
|
||||
# command: push
|
||||
# nuGetFeedType: external
|
||||
# feedsToUse: select
|
||||
# includeNuGetOrg: true
|
||||
# packagesToPush: $(Agent.TempDirectory)
|
||||
|
||||
- job: PyPIPublish
|
||||
displayName: "Publish to PyPI"
|
||||
pool:
|
||||
vmImage: "ubuntu-16.04"
|
||||
steps:
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
artifact: 'PythonPackage'
|
||||
path: dist
|
||||
- task: DownloadSecureFile@1
|
||||
name: pypirc
|
||||
inputs:
|
||||
secureFile: 'pypirc'
|
||||
- script: pip install --upgrade pip
|
||||
- script: python -m pip install --user -U setuptools importlib_metadata wheel twine
|
||||
# Uncomment on release:
|
||||
#- script: python -m twine upload --config-file $(pypirc.secureFilePath) -r $(pypiReleaseServer) dist/*
|
Loading…
Add table
Add a link
Reference in a new issue