|
73 | 73 | pythonVersion: "$(pythonVersion)"
|
74 | 74 | workerPath: "$(workerPath)"
|
75 | 75 | artifactName: "$(pythonVersion)_OSX_ARM64"
|
| 76 | + - bash: | |
| 77 | + echo "Releasing from $BUILD_SOURCEBRANCHNAME" |
| 78 | + sudo apt-get install -y jq |
| 79 | +
|
| 80 | + if [[ $BUILD_SOURCEBRANCHNAME = 4\.* ]] |
| 81 | + then |
| 82 | + echo "Generating V4 Release Package for $BUILD_SOURCEBRANCHNAME" |
| 83 | + NUSPEC="pack\Microsoft.Azure.Functions.V4.PythonWorker.nuspec" |
| 84 | + WKVERSION="$BUILD_SOURCEBRANCHNAME" |
| 85 | + elif [[ $BUILD_SOURCEBRANCHNAME = dev ]] |
| 86 | + then |
| 87 | + echo "Generating V4 Integration Test Package for $BUILD_SOURCEBRANCHNAME" |
| 88 | + VERSION=$(cat azure_functions_worker/version.py | tail -1 | cut -d' ' -f3 | sed "s/'//g") |
| 89 | + NUSPEC="pack\Microsoft.Azure.Functions.V4.PythonWorker.nuspec" |
| 90 | + WKVERSION="$VERSION-$(patchBuildNumberForDev)" |
| 91 | + else |
| 92 | + # this is only to test nuget related workflow because we are setting nuspec here |
| 93 | + echo "Generating Integration Test Package for $BUILD_SOURCEBRANCHNAME for testing purpose" |
| 94 | + LATEST_TAG=$(curl https://api.github.com/repos/Azure/azure-functions-python-worker/tags -s | jq '.[0].name' | sed 's/\"//g' | cut -d'.' -f-2) |
| 95 | + NUSPEC="pack\Microsoft.Azure.Functions.V4.PythonWorker.nuspec" |
| 96 | + # Only required for Integration Test. Version number contains date (e.g. 3.1.2.20211028-dev) |
| 97 | + WKVERSION="3.$LATEST_TAG-$(BUILD_BUILDID)-TEST" |
| 98 | + echo "No Matching Release Tag For $BUILD_SOURCEBRANCH" |
| 99 | + fi |
| 100 | +
|
| 101 | + echo "##vso[task.setvariable variable=nuspec_path]$NUSPEC" |
| 102 | + echo "##vso[task.setvariable variable=worker_version]$WKVERSION" |
| 103 | + displayName: "Generate Worker NuGet Package for Release $BUILD_SOURCEBRANCHNAME" |
| 104 | + - task: DownloadBuildArtifacts@0 |
| 105 | + inputs: |
| 106 | + buildType: 'current' |
| 107 | + downloadType: 'specific' |
| 108 | + downloadPath: '$(Build.SourcesDirectory)' |
| 109 | + - task: ManifestGeneratorTask@0 |
| 110 | + displayName: 'SBOM Generation Task' |
| 111 | + inputs: |
| 112 | + BuildDropPath: '$(Build.ArtifactStagingDirectory)' |
| 113 | + BuildComponentPath: '$(Build.SourcesDirectory)' |
| 114 | + Verbosity: 'Verbose' |
| 115 | + - task: CopyFiles@2 |
| 116 | + inputs: |
| 117 | + SourceFolder: '$(Build.ArtifactStagingDirectory)' |
| 118 | + Contents: '**' |
| 119 | + TargetFolder: '$(Build.SourcesDirectory)' |
| 120 | + - task: NuGetCommand@2 |
| 121 | + inputs: |
| 122 | + command: pack |
| 123 | + packagesToPack: '$(nuspec_path)' |
| 124 | + packDestination: $(Build.ArtifactStagingDirectory) |
| 125 | + versioningScheme: 'byEnvVar' |
| 126 | + versionEnvVar: WORKER_VERSION |
0 commit comments