diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b8ae51b..00a401c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -53,16 +53,6 @@ stages: testRunTitle: 'AP.MobileToolkit.Fonts' testResultsFiles: '**/*.trx' - - powershell: 'build\Sign-Packages.ps1' - displayName: 'Authenticode Sign Artifacts' - env: - SignClientUser: $(SignClientUser) - SignClientSecret: $(SignClientSecret) - SignClientClientId: $(SignClientClientId) - SignClientTenantId: $(SignClientTenantId) - SignServiceResourceId: $(SignServiceResourceId) - condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false)) - - task: PublishPipelineArtifact@1 displayName: Publish Pipeline Artifacts inputs: @@ -86,42 +76,4 @@ stages: command: push packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg' nuGetFeedType: external - publishFeedCredentials: 'AvaintPoint-MyGet' - - - stage: NuGet - displayName: Deploy to NuGet.org - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['system.pullrequest.isfork'], false), or(eq(variables['IS_PREVIEW'], 'true'), eq(variables['IS_RELEASE'], 'true'))) - jobs: - - deployment: NuGet - displayName: NuGet.org - environment: NuGet.org - strategy: - runOnce: - deploy: - steps: - - checkout: self - clean: true - - - powershell: build/Process-Release.ps1 - displayName: Process Release - - - task: GitHubRelease@1 - inputs: - action: create - gitHubConnection: GitHub - assets: $(Pipeline.Workspace)/**/*.nupkg - tag: 'v$(VersionName)' - tagSource: userSpecifiedTag - isPreRelease: $(IS_PREVIEW) - title: $(ReleaseDisplayName) - addChangeLog: true - enabled: $(DeployToNuGet) - - - task: NuGetCommand@2 - displayName: Push to NuGet.org - inputs: - command: push - packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg' - nuGetFeedType: external - publishFeedCredentials: 'NuGet' - enabled: $(DeployToNuGet) + publishFeedCredentials: 'AvaintPoint-MyGet' \ No newline at end of file diff --git a/build/Process-Release.ps1 b/build/Process-Release.ps1 deleted file mode 100644 index 871c8d3..0000000 --- a/build/Process-Release.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -$searchPath = "." - -if ($null -ne $env:PIPELINE_WORKSPACE) -{ - $searchPath = Join-Path -Path $env:PIPELINE_WORKSPACE -ChildPath 'Artifacts' -} - -Write-Host "Artifact search directory - $searchPath" -$nupkg = Get-ChildItem -Path $searchPath -Filter *.nupkg -Recurse | Select-Object -First 1 -$nupkg.Name -match '^(.*?)\.((?:\.?[0-9]+){3,}(?:[-a-z]+)?)\.nupkg$' - -$VersionName = $Matches[2] -$IsPreview = $VersionName -match '-pre$' -$DeployToNuGet = !($VersionName -match '-ci$') -$ReleaseDisplayName = $VersionName - -if($IsPreview -eq $true) -{ - $ReleaseDisplayName = "$VersionName - Preview" -} - -Write-Host "Version Name" $VersionName -Write-Host "IsPreview $IsPreview" -Write-Host "Deploy to NuGet: $DeployToNuGet" - -Write-Output ("##vso[task.setvariable variable=DeployToNuGet;]$DeployToNuGet") -Write-Output ("##vso[task.setvariable variable=VersionName;]$VersionName") -Write-Output ("##vso[task.setvariable variable=IsPreview;]$IsPreview") -Write-Output ("##vso[task.setvariable variable=ReleaseDisplayName;]$ReleaseDisplayName") \ No newline at end of file diff --git a/build/Sign-Packages.ps1 b/build/Sign-Packages.ps1 deleted file mode 100644 index 85662e7..0000000 --- a/build/Sign-Packages.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -$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; -} - -dotnet tool install --tool-path . SignClient - -# Setup Variables we need to pass into the sign client tool - -$appSettings = "$currentDirectory\appsettings.json" -$fileList = "$currentDirectory\filelist.txt" -$repoName = $env:BUILD_REPOSITORY_NAME -replace ".*/","" - -$azureAd = @{ - SignClient = @{ - AzureAd = @{ - AADInstance = $env:SignClientAADInstance - ClientId = $env:SignClientClientId - TenantId = $env:SignClientTenantId - } - Service = @{ - Url = $env:SignServiceUrl - ResourceId = $env:SignServiceResourceId - } - } -} - -$azureAd | ConvertTo-Json -Compress | Out-File $appSettings - -$nupkgs = Get-ChildItem $env:BUILD_ARTIFACTSTAGINGDIRECTORY\*.nupkg -recurse | Select-Object -ExpandProperty FullName - -foreach ($nupkg in $nupkgs){ - Write-Host "Submitting $nupkg for signing" - - .\SignClient 'sign' -c $appSettings -i $nupkg -f $fileList -r $env:SignClientUser -s $env:SignClientSecret -n $repoName -d $repoName -u $env:BUILD_REPOSITORY_URI - - Write-Host "Finished signing $nupkg" -} - -Write-Host "Sign-package complete"