Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
radekpetruska authored Apr 19, 2024
0 parents commit d2a1a9a
Show file tree
Hide file tree
Showing 27 changed files with 1,221 additions and 0 deletions.
139 changes: 139 additions & 0 deletions .azuredevops/pipelines/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: "$(Build.DefinitionName) #$(Build.BuildId)"

trigger: none # Manual Publish
pr: none # GitHub Actions handle PRs

parameters:
- name: AgentPoolName
displayName: Agent pool name
type: string
default: ADO Windows Server 2022

- name: AgentName
displayName: Agent name - single char for any
type: string
default: " "


resources:
repositories:
- repository: self
type: git

containers:
- container: Windows
image: base/mcr-dotnet-sdk-8.0-servercore-ltsc2022:release
endpoint: xperienceagentshub.azurecr.io

variables:
- name: SIGN_FILE
value: true

stages:
- stage: Build
jobs:
- job: Build
displayName: Build, Sign, and Pack

pool:
name: ${{ parameters.AgentPoolName }}
${{ if ne(length(parameters.AgentName), 1) }}:
demands:
- Agent.Name -equals ${{ parameters.AgentName }}
container: Windows

variables:
- group: Code Sign KV Auth

- name: Configuration
value: Release

- name: ProjectPath
value: src/PROJECT_NAME/PROJECT_NAME.csproj

steps:
- task: DotNetCoreCLI@2
displayName: Restore dotnet tools
inputs:
command: custom
custom: tool
arguments: restore
workingDirectory: $(System.DefaultWorkingDirectory)

- task: DotNetCoreCLI@2
displayName: Restore dependencies
inputs:
command: restore
projects: ${{ variables.ProjectPath }}
feedsToUse: select
restoreArguments: --locked-mode

- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: ${{ variables.ProjectPath }}
configuration: ${{ variables.Configuration }}
arguments: --no-restore
env:
AuthenticodeClientSecret: $(AuthenticodeClientSecret)
# Roll-forward behavior set for AzureSignTool dotnet tool (see .config\dotnet-tools.json) which requires .Net 6.0 runtime
DOTNET_ROLL_FORWARD: Major

- task: DotNetCoreCLI@2
displayName: Create NuGet package
inputs:
command: pack
packagesToPack: ${{ variables.ProjectPath }}
configuration: ${{ variables.Configuration }}
packDirectory: $(System.DefaultWorkingDirectory)/packages
includesymbols: true
nobuild: true
versioningScheme: off

- publish: $(System.DefaultWorkingDirectory)/packages
displayName: Publish NuGet package as artifact
artifact: artifact

- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- stage: PublishNuGetPackages
displayName: Publish NuGet packages
dependsOn: Build

jobs:
- deployment: PublishNuGetPackages
displayName: Publish NuGet packages

pool:
name: ${{ parameters.AgentPoolName }}
${{ if ne(length(parameters.AgentName), 1) }}:
demands:
- Agent.Name -equals ${{ parameters.AgentName }}
container: Windows

environment: integrations-release-nuget
workspace:
clean: all
strategy:
runOnce:
deploy:
steps:
- checkout: none

- task: NuGetToolInstaller@1
displayName: Install latest nuget.exe
inputs:
versionSpec: ">=5.6"
checkLatest: true

- task: NuGetAuthenticate@1
displayName: NuGet Authenticate

- task: NuGetCommand@2
displayName: NuGet push
inputs:
command: push
packagesToPush: $(Pipeline.Workspace)/artifact/*.nupkg
nuGetFeedType: external
publishFeedCredentials: nuget.org
allowPackageConflicts: true
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"azuresigntool": {
"version": "4.0.1",
"commands": [
"azuresigntool"
]
}
}
}
Loading

0 comments on commit d2a1a9a

Please sign in to comment.