-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Added Azure DevOps & NuGet Signing (#63)
- Loading branch information
1 parent
d077976
commit 6713ea2
Showing
4 changed files
with
144 additions
and
228 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
trigger: | ||
- master | ||
|
||
variables: | ||
VERBOSITY: normal | ||
GIT_SHA: $(Build.SourceVersion) | ||
GIT_BRANCH_NAME: $(Build.SourceBranchName) | ||
BUILD_NUMBER: $(Build.BuildId) | ||
MONO_VERSION: 5_16_0 | ||
XCODE_VERSION: 10.1 | ||
|
||
jobs: | ||
- job: build_windows | ||
displayName: Build (Windows) | ||
pool: | ||
vmImage: vs2017-win2016 | ||
steps: | ||
- powershell: .\build.ps1 | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: xUnit | ||
testResultsFiles: 'output/**/TestResult.xml' | ||
- task: PublishPipelineArtifact@0 | ||
inputs: | ||
artifactName: build_windows | ||
targetPath: 'output' | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
artifactName: nuget | ||
pathToPublish: 'output/nugets' | ||
|
||
- job: build_macos | ||
displayName: Build (macOS) | ||
pool: | ||
vmImage: macos-10.13 | ||
steps: | ||
- task: InstallAppleCertificate@2 | ||
inputs: | ||
certSecureFile: 'SkiaSharp iOS Certificate.p12' | ||
- task: InstallAppleCertificate@2 | ||
inputs: | ||
certSecureFile: 'SkiaSharp Mac Certificate.p12' | ||
- task: InstallAppleProvisioningProfile@1 | ||
inputs: | ||
provProfileSecureFile: 'SkiaSharp iOS Provisioning.mobileprovision' | ||
- task: InstallAppleProvisioningProfile@1 | ||
inputs: | ||
provProfileSecureFile: 'SkiaSharp Mac Provisioning.provisionprofile' | ||
- task: InstallAppleProvisioningProfile@1 | ||
inputs: | ||
provProfileSecureFile: 'SkiaSharp tvOS Provisioning.mobileprovision' | ||
- bash: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh $(MONO_VERSION) | ||
displayName: Switch to the latest Xamarin SDK | ||
- bash: echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_$(XCODE_VERSION).app;sudo xcode-select --switch /Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer | ||
displayName: Switch to the latest Xcode | ||
- powershell: .\build.ps1 | ||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFormat: xUnit | ||
testResultsFiles: 'output/**/TestResult.xml' | ||
- task: PublishPipelineArtifact@0 | ||
inputs: | ||
artifactName: build_macos | ||
targetPath: 'output' | ||
|
||
- job: signing | ||
displayName: Signing NuGets | ||
dependsOn: build_windows | ||
pool: | ||
name: VSEng-XamarinCustom | ||
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'],'refs/tags/')) | ||
steps: | ||
- checkout: none | ||
- template: azure-templates-sign.yml | ||
parameters: | ||
sourceRepo: mono/SkiaSharp.Extended | ||
targetFolder: 'output/signed' | ||
- task: PublishPipelineArtifact@0 | ||
inputs: | ||
artifactName: nuget-signed | ||
targetPath: 'output/signed' |
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,61 @@ | ||
parameters: | ||
targetFolder: '' | ||
sourceRepo: '' | ||
jenkinsEndpoint: '$(SIGNING_ENDPOINT)' | ||
jenkinsJob: '$(SIGNING_JOB)' | ||
artifactHost: '$(SIGNING_ARTIFACT_HOST)' | ||
githubToken: '$(GITHUB_TOKEN)' | ||
|
||
steps: | ||
|
||
- task: JenkinsQueueJob@2 | ||
displayName: 'Request Artifact Signing' | ||
inputs: | ||
serverEndpoint: ${{ parameters.jenkinsEndpoint }} | ||
jobName: ${{ parameters.jenkinsJob }} | ||
isParameterizedJob: true | ||
jobParameters: | | ||
REPO=${{ parameters.sourceRepo }} | ||
COMMIT=$(Build.SourceVersion) | ||
JOB_ID=$(System.DefinitionId) | ||
BUILD_ID=$(Build.BuildId) | ||
- powershell: | | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
Function Dump-Host { | ||
[cmdletbinding()] | ||
Param( | ||
$Message, | ||
[parameter(ValueFromPipeline)]$Data) | ||
Process { | ||
$_ = $Data | ||
if ($Message) { | ||
$Message = $ExecutionContext.InvokeCommand.ExpandString($Message) | ||
Write-Host $Message | ||
} else { | ||
Write-Host $Data | ||
} | ||
$Data | ||
} | ||
} | ||
$targetRoot = "${{ parameters.targetFolder }}" | ||
$jobId = "${{ parameters.azureJobId }}" | ||
$buildId = "$(Build.BuildId)" | ||
$token = "${{ parameters.githubToken }}" | ||
$url = "${{ parameters.artifactHost }}/$jobId-$buildId/metadata.json" | ||
Write-Host "Getting manifest from $url" | ||
$manifest = [string](Invoke-WebRequest -Uri $url -UseBasicParsing -Headers @{"Authorization"="token $token"}) | Dump-Host | ConvertFrom-Json | ||
if (!(Test-Path $targetRoot -PathType Container)) { | ||
New-Item -ItemType Directory -Force -Path $targetRoot | ||
} | ||
foreach ($file in $manifest) { | ||
$fileUrl = $file.url | ||
$fileName = [IO.Path]::GetFileName($fileUrl) | ||
Write-Host "Downloading artifact to $targetRoot/$fileName" | ||
Invoke-WebRequest -Uri $fileUrl -Headers @{"Authorization"="token $token"} -OutFile "$targetRoot/$fileName" | ||
} | ||
displayName: 'Download Signed Artifacts' |
This file was deleted.
Oops, something went wrong.
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