Skip to content

Commit

Permalink
add build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nytian committed Dec 5, 2024
1 parent 88bbbc7 commit 769f0ea
Showing 1 changed file with 137 additions and 0 deletions.
137 changes: 137 additions & 0 deletions templates/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
jobs:
- job: Build

templateContext:
outputs:
- output: pipelineArtifact
path: $(build.artifactStagingDirectory)
artifact: drop
sbomBuildDropPath: $(build.artifactStagingDirectory)
sbomPackageName: 'Durable Functions Extension SBOM'

steps:

# Configure all the .NET SDK versions we need
- task: UseDotNet@2
displayName: 'Use the .NET Core 2.1 SDK (required for build signing)'
inputs:
packageType: 'sdk'
version: '2.1.x'

- task: UseDotNet@2
displayName: 'Use the .NET Core 3.1 SDK'
inputs:
packageType: 'sdk'
version: '3.1.x'

- task: UseDotNet@2
displayName: 'Use the .NET 6 SDK'
inputs:
packageType: 'sdk'
version: '6.0.x'

# Start by restoring all the dependencies.
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: '**/**/*.csproj'
feedsToUse: config
nugetConfigPath: 'nuget.config'

# Build durable-extension
- task: VSBuild@1
displayName: 'Build Durable Extension'
inputs:
solution: '**/WebJobs.Extensions.DurableTask.sln'
vsVersion: "16.0"
configuration: Release
msbuildArgs: /p:FileVersionRevision=$(Build.BuildId) /p:ContinuousIntegrationBuild=true # these flags make package build deterministic

- template: ci/sign-files.yml@eng
parameters:
displayName: Sign assemblies
folderPath: 'src/WebJobs.Extensions.DurableTask/bin/Release'
pattern: '*DurableTask.dll'
signType: dll

- template: ci/sign-files.yml@eng
parameters:
displayName: Sign assemblies
folderPath: 'src/Worker.Extensions.DurableTask/bin/Release'
pattern: '*DurableTask.dll'
signType: dll

# dotnet pack
# Packaging needs to be a separate step from build.
# This will automatically pick up the signed DLLs.
- task: DotNetCoreCLI@2
displayName: 'dotnet pack WebJobs.Extensions.DurableTask.csproj'
inputs:
command: pack
packagesToPack: 'src/**/WebJobs.Extensions.DurableTask.csproj'
configuration: Release
packDirectory: $(build.artifactStagingDirectory)
nobuild: true


# dotnet pack
# Packaging needs to be a separate step from build.
# This will automatically pick up the signed DLLs.
- task: DotNetCoreCLI@2
displayName: 'dotnet pack Worker.Extensions.DurableTask.csproj'
inputs:
command: pack
packagesToPack: 'src/**/Worker.Extensions.DurableTask.csproj'
configuration: Release
packDirectory: $(build.artifactStagingDirectory)
nobuild: true

# Remove redundant symbol package(s)
- script: |
echo *** Searching for .symbols.nupkg files to delete...
dir /s /b *.symbols.nupkg
echo *** Deleting .symbols.nupkg files...
del /S /Q *.symbols.nupkg
echo *** Listing remaining packages
dir /s /b *.nupkg
displayName: 'Remove Redundant Symbols Package(s)'
continueOnError: true
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign NugetPackages
folderPath: $(build.artifactStagingDirectory)
pattern: '*.nupkg'
signType: nuget

# zip .NET in-proc perf tests
- task: DotNetCoreCLI@2
displayName: 'Zip .NET in-proc perf tests'
inputs:
command: 'publish'
publishWebProjects: false
projects: '$(System.DefaultWorkingDirectory)/test/PerfTests/DFPerfTests/**/*.csproj'
arguments: '-o $(System.DefaultWorkingDirectory)/test/PerfTests/DFPerfTests/Output'
zipAfterPublish: true
modifyOutputPath: true

# Move zip'ed .NET in-proc perf tests to the ADO publishing directory
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/test/PerfTests/DFPerfTests/Output/'
Contents: '**'
TargetFolder: '$(System.DefaultWorkingDirectory)/azure-functions-durable-extension/'

# We also need to build the Java smoke test, for CodeQL compliance
# We don't need to build the other smoke tests, because they can be analyzed without being compiled,
# as they're interpreted languages.
# This could be a separate pipeline, but the task is so small that it's paired with the .NET code build
# for convenience.
- pwsh: |
cd ./test/SmokeTests/OOProcSmokeTests/durableJava/
gradle build
ls
displayName: 'Build Java OOProc test (for CodeQL compliance)'

0 comments on commit 769f0ea

Please sign in to comment.