Skip to content

Commit 4caba99

Browse files
authored
Merge latest develop to master (including release pipeline) (#529)
1 parent 7a0c6ca commit 4caba99

41 files changed

Lines changed: 809 additions & 642 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ If you are running an older version (for example, if you originally installed WS
5252

5353
- `sudo do-release-upgrade` ... this updates the version of Ubuntu. _Please note_, this will likely disable any external package sources, such as the one added when installing Mono.
5454
- Once you're done with that, then you just need to update `apt-get`
55-
- Add back Mono's package repository source, as described in [the download instructions](https://www.mono-project.com/download/stable/#download-lin).
56-
- `sudo apt-get update`
57-
- `sudo apt-get upgrade`
58-
- `sudo apt-get dist-upgrade`
55+
- Steps to set up the local WSL mdoc environment
56+
- Install make `sudo apt-get install make`
57+
- Install mono, Add back Mono's package repository source, as described in [the download instructions](https://www.mono-project.com/download/stable/#download-lin-ubuntu).
58+
- Install Nuget `sudo apt-get install nuget`
59+
- Install F# Compiler `sudo apt-get install mono-complete fsharp`
5960

60-
With that run ... you should be able to run the build locally using `make all ENVIRONMENT=wsl`.
61+
With that run ... you should be able to run the build locally using `make prepare all check`.
6162

6263
### Linux
6364

azure-pipelines.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# ASP.NET Core (.NET Framework)
2+
# Build and test ASP.NET Core projects targeting the full .NET Framework.
3+
# Add steps that publish symbols, save build artifacts, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
5+
6+
trigger:
7+
- '*'
8+
9+
name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.r)
10+
11+
pool:
12+
vmImage: 'macos-latest'
13+
14+
variables:
15+
mdocPath: 'bin/$(buildConfiguration)'
16+
17+
steps:
18+
- task: NuGetToolInstaller@1
19+
displayName: Install NuGet Tool
20+
21+
- task: Bash@3
22+
displayName: Run Unit and Integration Tests
23+
inputs:
24+
targetType: 'inline'
25+
script: 'make prepare all check CONFIGURATION=$(buildConfiguration)'
26+
27+
- task: EsrpCodeSigning@1
28+
displayName: Sign executable and dll files
29+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
30+
inputs:
31+
ConnectedServiceName: 'CodeSigning-APEX'
32+
FolderPath: '$(mdocPath)'
33+
UseMinimatch: true
34+
signConfigType: inlineSignParams
35+
SessionTimeout: '60'
36+
MaxConcurrency: '100'
37+
MaxRetryAttempts: '5'
38+
Pattern: |
39+
*.dll
40+
*.exe
41+
inlineOperation: |
42+
[
43+
{
44+
"KeyCode": "CP-236167",
45+
"OperationSetCode": "SigntoolSign",
46+
"parameters": [
47+
{
48+
"parameterName": "OpusName",
49+
"parameterValue": "Microsoft"
50+
},
51+
{
52+
"parameterName": "OpusInfo",
53+
"parameterValue": "http://www.microsoft.com"
54+
},
55+
{
56+
"parameterName": "PageHash",
57+
"parameterValue": "/NPH"
58+
},
59+
{
60+
"parameterName": "TimeStamp",
61+
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
62+
},
63+
{
64+
"parameterName": "FileDigest",
65+
"parameterValue": "/fd \"SHA256\""
66+
}
67+
],
68+
"ToolName": "sign",
69+
"ToolVersion": "1.0"
70+
},
71+
{
72+
"KeyCode": "CP-236167",
73+
"OperationSetCode": "SigntoolVerify",
74+
"Parameters": [
75+
{
76+
"parameterName": "VerifyAll",
77+
"parameterValue": "/all"
78+
}
79+
],
80+
"ToolName": "sign",
81+
"ToolVersion": "1.0"
82+
}
83+
]
84+
85+
- task: ArchiveFiles@2
86+
displayName: Archive mdoc Files
87+
inputs:
88+
rootFolderOrFile: '$(mdocPath)'
89+
includeRootFolder: false
90+
archiveType: 'zip'
91+
archiveFile: '$(Build.ArtifactStagingDirectory)/zips/mdoc-$(Build.BuildNumber).zip'
92+
replaceExistingArchive: true
93+
94+
- task: PublishBuildArtifacts@1
95+
displayName: 'Publish mdoc Artifact'
96+
inputs:
97+
PathtoPublish: '$(Build.ArtifactStagingDirectory)/zips'
98+
ArtifactName: 'mdoc.Artifact'
99+
100+
- task: PowerShell@2
101+
name: 'mdocVersion'
102+
displayName: 'Checking remote and local version of mdoc'
103+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
104+
inputs:
105+
filePath: 'mdoc/CheckNugetPublish.ps1'
106+
107+
- task: NuGetCommand@2
108+
displayName: 'Create a NuGet package for mdoc'
109+
condition: eq(variables['mdocVersion.NeedUpdate'], true)
110+
inputs:
111+
command: 'pack'
112+
packagesToPack: 'mdoc/mdoc.nuspec'
113+
114+
- task: NuGetCommand@2
115+
displayName: 'Publishing mdoc package to nuget.org'
116+
condition: eq(variables['mdocVersion.NeedUpdate'], true)
117+
inputs:
118+
command: 'push'
119+
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
120+
nuGetFeedType: 'external'
121+
publishFeedCredentials: 'modc_nuget_org'

mdoc/CheckNugetPublish.ps1

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
$packageName = "mdoc"
2+
$packageOwner = "Microsoft"
3+
$nugetConfigPath = "mdoc/mdoc.nuspec"
4+
5+
$nugetSearchResult = nuget list PackageId:$packageName Owner:$packageOwner
6+
$packageSearchResult = $nugetSearchResult.Split(' ')
7+
if ($packageSearchResult.Count -ne 2)
8+
{
9+
Write-Host "Searching $packageName on nuget.org returns an invalid result: $nugetSearchResult"
10+
return
11+
}
12+
13+
$remoteLatestVersion = $packageSearchResult[1]
14+
Write-Host "The lastest version of $packageName on nuget.org is: $remoteLatestVersion"
15+
if (!$remoteLatestVersion)
16+
{
17+
Write-Host "Current lastest version of $packageName on nuget.org is an invalid value."
18+
return
19+
}
20+
21+
[xml]$localNugetConfig = Get-Content($nugetConfigPath)
22+
$localVersion = $localNugetConfig.package.metadata.version
23+
Write-Host "The local version of $packageName in package metadata file is: $localVersion"
24+
if (!$localVersion)
25+
{
26+
Write-Host "Current local version of $packageName in package metadata file is an invalid value."
27+
return
28+
}
29+
30+
$needUpdate = $false
31+
if ($localVersion -gt $remoteLatestVersion)
32+
{
33+
$needUpdate = $true
34+
Write-Host "We need to publish a new version to nuget.org."
35+
}
36+
37+
Write-Host "##vso[task.setvariable variable=NeedUpdate;isOutput=true]$needUpdate"
38+
Write-Host "##vso[task.setvariable variable=Version;isOutput=true]$localVersion"

0 commit comments

Comments
 (0)