Skip to content

Commit

Permalink
Refactor for continuity and cleanliness
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenBond committed Jan 11, 2024
1 parent f654bdc commit 7e72e16
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 292 deletions.
244 changes: 34 additions & 210 deletions .azure/pipelines/build.yaml
@@ -1,3 +1,22 @@
trigger:
branches:
include:
- main
paths:
exclude:
- samples

pr: none

schedules:
- cron: "0 0 * * *"
displayName: 'Daily midnight build (including CodeQL)'
branches:
include:
- main
- 3.x
always: true

parameters:
- name: build_configuration
displayName: Build configuration
Expand Down Expand Up @@ -26,10 +45,6 @@ parameters:
displayName: Skip tests
type: boolean
default: false
- name: publish_nightly
displayName: Publish to orleans-nightly
type: boolean
default: false
- name: frameworks
displayName: Frameworks
type: object
Expand All @@ -47,210 +62,19 @@ parameters:
displayName: Run CodeQL3000 tasks
type: boolean

jobs:

# Build, sign dlls, build nuget pkgs, then sign them
- job: Build
pool: $(pool_name)
displayName: Build and create NuGet packages
steps:
- checkout: self
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
useGlobalJson: true
- ${{ if eq(variables.runCodeQL3000, 'true') }}:
- task: CodeQL3000Init@0
displayName: CodeQL Initialize
# This task only tags a build if it actually does CodeQL3000 work.
# Those tasks no-op while the analysis is considered up to date i.e. for runs w/in a few days of each other.
- script: "echo ##vso[build.addbuildtag]CodeQL3000"
displayName: 'Set CI CodeQL3000 tag'
condition: ne(variables.CODEQL_DIST,'')
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
arguments: '$(build_flags) /bl:${{parameters.build_configuration}}-Build.binlog /p:Configuration=${{parameters.build_configuration}} $(solution)'
env:
VersionPrefix: ${{parameters.version_prefix}}
${{ if eq(parameters.include_suffix, true) }}:
VersionSuffix: ${{parameters.version_suffix}}
OfficialBuild: $(official_build)
- ${{ if eq(variables.runCodeQL3000, 'true') }}:
- task: CodeQL3000Finalize@0
displayName: CodeQL Finalize
# DLL code signing
- ${{ if eq(parameters.codesign, true) }}:
- task: UseDotNet@2
displayName: 'Codesign: Use .NET Core'
inputs:
packageType: runtime
version: $(codesign_runtime)
- task: CopyFiles@2
displayName: 'Codesign: Copy Files for signing'
inputs:
SourceFolder: '$(build.sourcesdirectory)'
Contents: |
src/**/bin/${{parameters.build_configuration}}/**/Orleans*.dll
src/**/bin/${{parameters.build_configuration}}/**/Microsoft.Orleans.*.dll
!src/BootstrapBuild/**
TargetFolder: '$(build.artifactstagingdirectory)\codesign'
CleanTargetFolder: true
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'Codesign: ESRP CodeSigning'
inputs:
ConnectedServiceName: 'CodeSign Service (NuGet)'
FolderPath: '$(build.artifactstagingdirectory)\codesign'
Pattern: '*'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 180
VerboseLogin: true
- task: CopyFiles@2
displayName: 'Codesign: Copy Signed Files Back'
inputs:
SourceFolder: '$(build.artifactstagingdirectory)\codesign'
Contents: '**\*'
TargetFolder: '$(build.sourcesdirectory)'
OverWrite: true
# End DLL code signing
- task: CmdLine@2
displayName: Pack
inputs:
script: 'dotnet pack --no-build --no-restore $(build_flags) /bl:${{parameters.build_configuration}}-Pack.binlog /p:Configuration=${{parameters.build_configuration}} $(solution)'
env:
VersionPrefix: ${{parameters.version_prefix}}
${{ if eq(parameters.include_suffix, true) }}:
VersionSuffix: ${{parameters.version_suffix}}
OfficialBuild: $(official_build)
# NuGet code signing
- ${{ if eq(parameters.codesign, true) }}:
- task: UseDotNet@2
displayName: 'Codesign: Use .NET Core'
inputs:
packageType: runtime
version: $(codesign_runtime)
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'Codesign: ESRP CodeSigning (nuget)'
inputs:
ConnectedServiceName: 'CodeSign Service (NuGet)'
FolderPath: '$(build.sourcesdirectory)/Artifacts/${{parameters.build_configuration}}'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 180
VerboseLogin: true
# End NuGet code signing
- ${{ if ne(variables['System.TeamProject'], 'GitHub - PR Builds') }}:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Nuget Packages'
inputs:
PathtoPublish: '$(build.sourcesdirectory)/Artifacts/${{parameters.build_configuration}}'
ArtifactName: nuget
variables:
- template: templates/vars.yaml

# Tests
- ${{ if and(eq(parameters.skip_test, false), ne(variables.runCodeQL3000, 'true')) }}:
- ${{ each category in parameters.tests_categories }}:
- ${{ each framework in parameters.frameworks }}:
- job:
displayName: ${{category}} on ${{framework}}
timeoutInMinutes: 120
pool: $(pool_name)
dependsOn: Build
steps:
- checkout: self
- task: UseDotNet@2
inputs:
useGlobalJson: true
displayName: 'Use .NET Core sdk'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
arguments: '$(build_flags) /bl:${{parameters.build_configuration}}-Build.binlog /p:Configuration=${{parameters.build_configuration}} $(solution)'
- ${{ if ne(variables['System.TeamProject'], 'GitHub - PR Builds') }}:
- task: DownloadSecureFile@1
name: secretFile
displayName: 'Download secrets'
inputs:
secureFile: 'OrleansTestSecrets.json'
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: 'test'
testRunTitle: ${{category}} on ${{framework}}
arguments: '--no-build --framework ${{framework}} --configuration "${{parameters.build_configuration}}" --filter Category=${{category}} -- -parallel none -noshadow'
${{ if ne(variables['System.TeamProject'], 'GitHub - PR Builds') }}:
env:
ORLEANS_SECRETFILE: $(secretFile.secureFilePath)

# Publish packages to nightly feed
- ${{ if and(eq(parameters.codesign, true), eq(parameters.publish_nightly, true)) }}:
- job: Publish
dependsOn: Build
steps:
- download: current
artifact: nuget
- task: NuGetAuthenticate@1
displayName: 'NuGet Authenticate'
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
publishVstsFeed: 'orleans-public/orleans-nightly'
packagesToPush: $(Pipeline.Workspace)/nuget/**/*.nupkg
allowPackageConflicts: true
jobs:
- template: templates/build.yaml
parameters:
build_configuration: ${{ parameters.build_configuration }}
version_prefix: ${{ parameters.version_prefix }}
include_suffix: ${{ parameters.include_suffix }}
version_suffix: ${{ parameters.version_suffix }}
codesign: ${{ parameters.codesign }}
skip_test: ${{ parameters.skip_test }}
publish_nightly: false
frameworks: ${{ parameters.frameworks }}
tests_categories: ${{ parameters.tests_categories }}
runCodeQL3000: ${{ parameters.runCodeQL3000 }}
80 changes: 0 additions & 80 deletions .azure/pipelines/ci.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .azure/pipelines/nightly-main.yaml
Expand Up @@ -10,10 +10,10 @@ schedules:
always: false

variables:
- template: vars.yaml
- template: templates/vars.yaml

jobs:
- template: build.yaml
- template: templates/build.yaml
parameters:
build_configuration: Release
include_suffix: true
Expand Down

0 comments on commit 7e72e16

Please sign in to comment.