Skip to content

Commit

Permalink
Jfleisher/nightlynuget (#5916)
Browse files Browse the repository at this point in the history
* WiP: Test nightly version number change

* Fix debug assert

* WiP: test nuget publish to AzDo feed for nightly build

* WiP: Make Nuget deploy separate stage

* WiP: fix nightly stage name

* change nuget push to vstsfeed

* Try case sensitive name for artifacts

* WiP: use artifact folder names

* add Rev version to package

* WiP: build def variation on nightly build version

* WiP: use Build_BuildNumber and Build_DefinitionName

* WiP: using hyphen in nightly version

* Tag nightly packages with datetime

* fix commit

* Build.BuildId and Build.DefinitionName

* WiP: change suffix format to lead with alpha

* test z3public feed publish

* revert public publish test

* WiP: test build# versioning scheme

* WiP: another variant on version number for nightly

Co-authored-by: jfleisher <jofleish@microsoft.com>
Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
3 people authored Mar 22, 2022
1 parent 815c971 commit ce04c16
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 10 deletions.
68 changes: 59 additions & 9 deletions scripts/nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
variables:
ReleaseVersion: '4.8.16'

Major: '4'
Minor: '8'
Patch: '16'
NightlyVersion: $(Major).$(Minor).$(Patch).$(Build.BuildId)-$(Build.DefinitionName)
MacFlags: 'CXXFLAGS="-arch arm64 -arch x86_64" LINK_EXTRA_FLAGS="-arch arm64 -arch x86_64" SLINK_EXTRA_FLAGS="-arch arm64 -arch x86_64" FPMATH_ENABLED=False'

stages:
Expand Down Expand Up @@ -131,6 +135,8 @@ stages:
targetPath: $(Build.ArtifactStagingDirectory)
artifactName: 'Windows64'



- stage: Package
jobs:
- job: NuGet64
Expand Down Expand Up @@ -171,7 +177,7 @@ stages:
workingDirectory: $(Agent.TempDirectory)\package
arguments:
$(Agent.TempDirectory)\package
$(ReleaseVersion)
$(NightlyVersion)
$(Build.Repository.Uri)
$(Build.SourceBranchName)
$(Build.SourceVersion)
Expand All @@ -181,13 +187,17 @@ stages:
displayName: 'NuGet Pack Symbols'
inputs:
command: custom
arguments: 'pack $(Agent.TempDirectory)\package\out\Microsoft.Z3.sym.nuspec -OutputDirectory $(Build.ArtifactStagingDirectory) -Verbosity detailed -Symbols -SymbolPackageFormat snupkg -BasePath $(Agent.TempDirectory)\package\out'
versioningScheme: byPrereleaseNumber
majorVersion: $(Major)
minorVersion: $(Minor)
patchVersion: $(Patch)
arguments: 'pack $(Agent.TempDirectory)\package\out\Microsoft.Z3.sym.nuspec -Version $(NightlyVersion) -OutputDirectory $(Build.ArtifactStagingDirectory) -Verbosity detailed -Symbols -SymbolPackageFormat snupkg -BasePath $(Agent.TempDirectory)\package\out'
- task: EsrpCodeSigning@1
displayName: 'Sign Package'
inputs:
ConnectedServiceName: 'z3-esrp-signing-2'
FolderPath: $(Build.ArtifactStagingDirectory)
Pattern: Microsoft.Z3.$(ReleaseVersion).nupkg
Pattern: Microsoft.Z3.$(NightlyVersion).nupkg
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand All @@ -214,7 +224,7 @@ stages:
inputs:
ConnectedServiceName: 'z3-esrp-signing-2'
FolderPath: $(Build.ArtifactStagingDirectory)
Pattern: Microsoft.Z3.$(ReleaseVersion).snupkg
Pattern: Microsoft.Z3.$(NightlyVersion).snupkg
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand Down Expand Up @@ -269,7 +279,7 @@ stages:
workingDirectory: $(Agent.TempDirectory)\package
arguments:
$(Agent.TempDirectory)\package
$(ReleaseVersion)
$(NightlyVersion)
$(Build.Repository.Uri)
$(Build.SourceBranchName)
$(Build.SourceVersion)
Expand All @@ -280,13 +290,17 @@ stages:
displayName: 'NuGet Pack Symbols'
inputs:
command: custom
arguments: 'pack $(Agent.TempDirectory)\package\out\Microsoft.Z3.x86.sym.nuspec -OutputDirectory $(Build.ArtifactStagingDirectory) -Verbosity detailed -Symbols -SymbolPackageFormat snupkg -BasePath $(Agent.TempDirectory)\package\out'
versioningScheme: byPrereleaseNumber
majorVersion: $(Major)
minorVersion: $(Minor)
patchVersion: $(Patch)
arguments: 'pack $(Agent.TempDirectory)\package\out\Microsoft.Z3.x86.sym.nuspec -Version $(NightlyVersion) -OutputDirectory $(Build.ArtifactStagingDirectory) -Verbosity detailed -Symbols -SymbolPackageFormat snupkg -BasePath $(Agent.TempDirectory)\package\out'
- task: EsrpCodeSigning@1
displayName: 'Sign Package'
inputs:
ConnectedServiceName: 'z3-esrp-signing-2'
FolderPath: $(Build.ArtifactStagingDirectory)
Pattern: Microsoft.Z3.x86.$(ReleaseVersion).nupkg
Pattern: Microsoft.Z3.x86.$(NightlyVersion).nupkg
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand All @@ -313,7 +327,7 @@ stages:
inputs:
ConnectedServiceName: 'z3-esrp-signing-2'
FolderPath: $(Build.ArtifactStagingDirectory)
Pattern: Microsoft.Z3.x86.$(ReleaseVersion).snupkg
Pattern: Microsoft.Z3.x86.$(NightlyVersion).snupkg
signConfigType: 'inlineSignParams'
inlineOperation: |
[
Expand Down Expand Up @@ -449,5 +463,41 @@ stages:
isDraft: false
isPreRelease: true

- stage: NugetPublishNightly
jobs:
# Publish to nightly feed on Azure
- job: NuGetPublishNightly
displayName: "Push nuget packages to Azure Feed"
steps:
- task: NuGetAuthenticate@0
displayName: 'NuGet Authenticate'
- task: NuGetToolInstaller@0
inputs:
versionSpec: 5.x
checkLatest: false
- task: DownloadPipelineArtifact@2
displayName: 'Download NuGet x86 Package'
inputs:
artifact: 'NuGet32'
path: $(Agent.TempDirectory)/x86
- task: DownloadPipelineArtifact@2
displayName: 'Download NuGet x64 Package'
inputs:
artifact: 'NuGet'
path: $(Agent.TempDirectory)/x64
- task: NuGetCommand@2
displayName: 'NuGet Nightly x64 push'
inputs:
command: push
publishVstsFeed: 'Z3Build/Z3-Nightly-builds'
packagesToPush: $(Agent.TempDirectory)/x64/*.nupkg
allowPackageConflicts: true
- task: NuGetCommand@2
displayName: 'NuGet Nightly x86 push'
inputs:
command: push
publishVstsFeed: 'Z3Build/Z3-Nightly-builds'
packagesToPush: $(Agent.TempDirectory)/x86/*.nupkg
allowPackageConflicts: true

# TBD: run regression tests on generated binaries.
2 changes: 1 addition & 1 deletion src/api/dotnet/NativeSolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public override string ToString()

internal NativeSolver(NativeContext nativeCtx, Z3_solver z3solver)
{
Debug.Assert(nCtx != IntPtr.Zero);
Debug.Assert(nativeCtx != null);
Debug.Assert(z3solver != IntPtr.Zero);

this.ntvContext = nativeCtx;
Expand Down

0 comments on commit ce04c16

Please sign in to comment.