-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Oren Novotny
committed
Sep 18, 2018
1 parent
bd96ff8
commit f8e37b1
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
trigger: | ||
- master | ||
- rel/* | ||
|
||
pool: | ||
vmImage: vs2017-win2016 | ||
|
||
variables: | ||
BuildConfiguration: Release | ||
|
||
steps: | ||
- task: DotNetCoreCLI@2 | ||
inputs: | ||
command: custom | ||
custom: tool | ||
arguments: install --tool-path . nbgv | ||
displayName: Install NBGV tool | ||
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) | ||
|
||
- script: nbgv cloud | ||
displayName: Set Version | ||
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) | ||
|
||
- task: MSBuild@1 | ||
inputs: | ||
solution: .\MiFare.sln | ||
configuration: $(BuildConfiguration) | ||
msbuildArguments: /restore | ||
maximumCpuCount: true | ||
displayName: Build Solution | ||
|
||
- task: MSBuild@1 | ||
inputs: | ||
solution: .\src\MiFare\MiFare.csproj | ||
configuration: $(BuildConfiguration) | ||
msbuildArguments: /t:Pack /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\Packages | ||
maximumCpuCount: true | ||
displayName: Pack MiFare | ||
|
||
- task: PowerShell@2 | ||
displayName: Authenticode Sign artifacts | ||
inputs: | ||
filePath: scripts/Sign-Package.ps1 | ||
env: | ||
SignClientUser: $(SignClientUser) | ||
SignClientSecret: $(SignClientSecret) | ||
ArtifactDirectory: $(Build.ArtifactStagingDirectory)\Packages | ||
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], ''))) | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: Publish Package Artifacts | ||
inputs: | ||
pathToPublish: $(Build.ArtifactStagingDirectory)\Packages | ||
artifactType: container | ||
artifactName: Packages | ||
condition: eq(variables['system.pullrequest.isfork'], false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$currentDirectory = split-path $MyInvocation.MyCommand.Definition | ||
|
||
# See if we have the ClientSecret available | ||
if([string]::IsNullOrEmpty($env:SignClientSecret)){ | ||
Write-Host "Client Secret not found, not signing packages" | ||
return; | ||
} | ||
|
||
# Setup Variables we need to pass into the sign client tool | ||
dotnet tool install --tool-path . SignClient | ||
|
||
$appSettings = "$currentDirectory\appsettings.json" | ||
|
||
$nupgks = ls $Env:ArtifactDirectory\*.nupkg | Select -ExpandProperty FullName | ||
|
||
foreach ($nupkg in $nupgks){ | ||
Write-Host "Submitting $nupkg for signing" | ||
|
||
.\SignClient 'sign' -c $appSettings -i $nupkg -r $env:SignClientUser -s $env:SignClientSecret -n 'MiFare' -d 'MiFare' -u 'https://github.com/onovotny/MiFare' | ||
|
||
Write-Host "Finished signing $nupkg" | ||
} | ||
|
||
Write-Host "Sign-package complete" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"SignClient": { | ||
"AzureAd": { | ||
"AADInstance": "https://login.microsoftonline.com/", | ||
"ClientId": "6632f806-5a64-4bc6-87cf-b622b2ec62d3", | ||
"TenantId": "71048637-3782-41a3-b6b2-6f4ac8a25ae0" | ||
}, | ||
"Service": { | ||
"Url": "https://codesign.novotny.org/", | ||
"ResourceId": "https://SignService/0263d4ba-331b-46d1-85e1-bee9898a65a6" | ||
} | ||
} | ||
} |