This commit is contained in:
Jerome Laban 2020-11-02 12:04:44 -05:00
Родитель 1fec7377a9
Коммит ecbad3d9f7
7 изменённых файлов: 138 добавлений и 0 удалений

43
.vsts-ci.yml Normal file
Просмотреть файл

@ -0,0 +1,43 @@
jobs:
- job: Windows
pool:
vmImage: 'windows-2019'
steps:
- task: GitVersion@5
inputs:
updateAssemblyInfo: false
configFilePath: gitversion.yml
- task: MSBuild@1
inputs:
solution: MonacoEditorComponent.sln
msbuildArguments: /r /p:Configuration=Release "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=%GITVERSION_FullSemVer%" "/p:InformationalVersion=%GITVERSION_InformationalVersion%" /detailedsummary
- task: PowerShell@2
displayName: Authenticode Sign Packages
inputs:
filePath: build/Sign-Package.ps1
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
SignPackageName: "uno.monaco-editor-uwp"
SignPackageDescription: "uno.monaco-editor-uwp"
ArtifactDirectory: $(build.artifactstagingdirectory)
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
# - task: CopyFiles@2
# inputs:
# SourceFolder: $(build.sourcesdirectory)/src/WasmWebSocketsSample/WasmWebSocketsSample.Wasm/bin/Release/netstandard2.0/dist
# Contents: "**/*.*"
# TargetFolder: $(build.artifactstagingdirectory)\wasm
# CleanTargetFolder: false
# OverWrite: false
# flattenFolders: false
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uno-monaco-editor-uwp-drop
ArtifactType: Container

Просмотреть файл

@ -8,6 +8,8 @@ using Windows.Foundation.Metadata;
#if !NETSTANDARD2_0
using System.Runtime.InteropServices.WindowsRuntime;
#else
using ReadOnlyArrayAttribute = Monaco.Helpers.Stubs.ReadOnlyArrayAttribute;
#endif
namespace Monaco.Helpers

Просмотреть файл

@ -2,6 +2,8 @@
#if !NETSTANDARD2_0
using System.Runtime.InteropServices.WindowsRuntime;
#else
using ReadOnlyArrayAttribute = Monaco.Helpers.Stubs.ReadOnlyArrayAttribute;
#endif
namespace Monaco.Editor

Просмотреть файл

@ -2,6 +2,8 @@
#if !NETSTANDARD2_0
using System.Runtime.InteropServices.WindowsRuntime;
#else
using ReadOnlyArrayAttribute = Monaco.Helpers.Stubs.ReadOnlyArrayAttribute;
#endif
namespace Monaco.Languages

13
build/SignClient.json Normal file
Просмотреть файл

@ -0,0 +1,13 @@
{
"SignClient": {
"AzureAd": {
"AADInstance": "https://login.microsoftonline.com/",
"ClientId": "8138ef14-0570-432c-8aad-9f73f05297d5",
"TenantId": "6d53ef61-b6d1-4150-ae0b-43b90e75e0cd"
},
"Service": {
"Url": "https://nv-signservice.azurewebsites.net",
"ResourceId": "https://SignService/715027a2-5a78-4271-9a16-f4502f1706fe"
}
}
}

22
build/sign-package.ps1 Normal file
Просмотреть файл

@ -0,0 +1,22 @@
$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\SignClient.json"
$filesToSign = Get-ChildItem -Recurse $Env:ArtifactDirectory\* -Include *.nupkg,*.vsix | Select-Object -ExpandProperty FullName
foreach ($fileToSign in $filesToSign) {
Write-Host "Submitting $fileToSign for signing"
.\SignClient 'sign' -c $appSettings -i $fileToSign -r $env:SignClientUser -s $env:SignClientSecret -n "$env:SignPackageName" -d "$env:SignPackageDescription" -u "$env:build_repository_uri"
Write-Host "Finished signing $fileToSign"
}
Write-Host "Sign-package complete"

54
gitversion.yml Normal file
Просмотреть файл

@ -0,0 +1,54 @@
assembly-versioning-scheme: MajorMinorPatch
mode: Mainline
next-version: 1.0.0
branches:
master:
mode: ContinuousDeployment
regex: master
tag: dev
increment: Minor
is-source-branch-for: ['beta', 'stable']
pull-request:
regex: ^(pull|pull\-requests|pr)[/-]
mode: ContinuousDeployment
tag: 'PullRequest'
tag-number-pattern: '[/-](?<number>\d+)[-/]'
increment: Inherit
beta:
mode: ContinuousDeployment
regex: ^release/beta/.*
tag: beta
increment: none
source-branches: ['master']
stable:
regex: ^release/stable/.*
tag: ''
increment: Patch
source-branches: ['master','beta']
is-mainline: true
dev:
mode: ContinuousDeployment
regex: ^dev/.*?/(.*?)
tag: dev.{BranchName}
source-branches: ['master', 'release', 'projects', 'feature']
increment: none
projects:
tag: proj-{BranchName}
regex: ^projects/(.*?)
source-branches: ['master']
increment: none
feature:
tag: feature.{BranchName}
regex: ^feature/(.*?)
source-branches: ['master']
increment: none
ignore:
sha: []