Skip to content
48 changes: 45 additions & 3 deletions .azuredevops/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,72 @@ parameters:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-latest
os: windows
runtime: win-x64
- pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: ubuntu-latest
os: linux
runtime: linux-x64
- pool:
name: Azure Pipelines
image: macOS-latest
os: macOS
runtime: osx-x64
- pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-latest
os: windows
runtime: win-arm64
archiveExt: zip
- pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: ubuntu-latest
os: linux
runtime: linux-arm64
archiveExt: tar.gz
- pool:
name: Azure Pipelines
image: macOS-latest
os: macOS
runtime: osx-arm64
archiveExt: tar.gz

stages:
- stage: build
displayName: Build And Test
jobs:
- ${{ each config in parameters.buildConfigs }}:
- job: build_${{ config.pool.os }}
displayName: Building and Testing on ${{ config.pool.os }}
- job: build_${{ replace(config.runtime, '-', '_') }}
displayName: Building and Testing on ${{ config.runtime }}
pool:
name: ${{ config.pool.name }}
image: ${{ config.pool.image }}
os: ${{ config.pool.os }}
templateContext:
outputs:
- output: pipelineArtifact
targetPath: dist/${{ config.runtime }}
artifactName: azureauth-${{ config.runtime }}
steps:
- checkout: self
- task: UseDotNet@2
displayName: Use .NET Core sdk 8.x
inputs:
version: 8.x
- task: NuGetToolInstaller@0
displayName: Use NuGet 6.x
inputs:
versionSpec: 6.x
- task: NuGetAuthenticate@1
displayName: Authenticate to Azure Artifacts
- task: DotNetCoreCLI@2
displayName: Install dependencies
inputs:
command: restore
feedsToUse: select
vstsFeed: Office
includeNuGetOrg: false
arguments: --runtime ${{ config.runtime }}
# 1ES PT requires explicit build task for Roslyn analysis. Auto-injected Roslyn task will use build logs from this build.
- task: DotNetCoreCLI@2
displayName: Build projects
Expand All @@ -50,4 +83,13 @@ stages:
displayName: Test
inputs:
command: test
arguments: --no-restore --no-build --verbosity normal
arguments: --no-restore --no-build --verbosity normal
- task: DotNetCoreCLI@2
displayName: Publish artifacts
inputs:
command: publish
projects: src/AzureAuth/AzureAuth.csproj
arguments: --configuration release --self-contained true --runtime ${{ config.runtime }} --output dist/${{ config.runtime }}
publishWebProjects: false
zipAfterPublish: false
modifyOutputPath: true
4 changes: 2 additions & 2 deletions src/AzureAuth/Commands/Ado/CommandPat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public int OnExecute(ILogger<CommandPat> logger, IPublicClientAuth publicClientA
var pat = manager.GetPatAsync(this.PatOptions()).Result;

// Do not use logger to avoid printing PATs into log files.
Console.Write(FormatPat(pat, this.Output));
Console.WriteLine(FormatPat(pat, this.Output));
}

return 0;
Expand Down Expand Up @@ -275,4 +275,4 @@ private IPatCache Cache()
return new PatCache(storageWrapper);
}
}
}
}
2 changes: 1 addition & 1 deletion src/AzureAuth/Commands/Ado/CommandToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public int OnExecute(ILogger<CommandToken> logger, IEnv env, ITelemetryService t
}

// Do not use logger to avoid printing tokens into log files.
Console.Write(FormatToken(token.Token, this.Output, Authorization.Bearer));
Console.WriteLine(FormatToken(token.Token, this.Output, Authorization.Bearer));
return 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/AzureAuth/Commands/CommandAad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private int GetToken(IPublicClientAuth publicClientAuth)
this.logger.LogSuccess(tokenResult.ToString());
break;
case OutputMode.Token:
Console.Write(tokenResult.Token);
Console.WriteLine(tokenResult.Token);
break;
case OutputMode.Json:
Console.Write(tokenResult.ToJson());
Expand Down
Loading
Loading