File tree Expand file tree Collapse file tree 6 files changed +47
-17
lines changed
Expand file tree Collapse file tree 6 files changed +47
-17
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Released under the MIT License. See the [LICENSE][] File for further details.
1313## Installation
1414Install ` https ` as a global .NET tool using
1515``` bash
16- dotnet tool install --global https --version 0.1.2 -*
16+ dotnet tool install --global https --version 0.2.0 -*
1717```
1818
1919## Usage
Original file line number Diff line number Diff line change 1+ $ReadmePath = Join-Path $PSScriptRoot ' README.md'
2+ If (-not (Test-Path $ReadmePath )) {
3+ Write-Error ' Unable to find README.md'
4+ Exit 1
5+ }
6+
7+ $ReadmeContents = Get-Content $ReadmePath - Raw
8+ [regex ]$Regex = ' dotnet tool install --global https --version (.+)-\*'
9+ $Match = $Regex.Match ($ReadmeContents )
10+ If (-not $Match.Success ) {
11+ Write-Error ' Unable to find version information in README.md'
12+ Exit 1
13+ }
14+
15+ $HttpsCsprojPath = Join-Path $PSScriptRoot ' src/https/https.csproj'
16+ If (-not (Test-Path $HttpsCsprojPath )) {
17+ Write-Error ' Unable to find https.csproj'
18+ Exit 1
19+ }
20+
21+ [xml ]$HttpsCsproj = Get-Content $HttpsCsprojPath
22+
23+ $Expected = $HttpsCsproj.Project.PropertyGroup.VersionPrefix |
24+ Where-Object { $null -ne $_ } |
25+ ForEach-Object { $_.ToString ().Trim() }
26+ $Actual = $Match.Groups [1 ].ToString().Trim()
27+ If ($Expected -ne $Actual ) {
28+ Write-Error " Expected to have ${Expected} version in README.md, but found ${Actual} "
29+ Exit 1
30+ }
Original file line number Diff line number Diff line change @@ -10,12 +10,11 @@ variables:
1010 buildConfiguration : ' Release'
1111
1212steps :
13- - task : DotNetCoreInstaller@1
14- displayName : Install .NET Core 3.0 Preview
13+ - task : PowerShell@2
14+ displayName : Test Readme
1515 inputs :
16- includePreviewVersions : true
17- packageType : sdk
18- version : 3.0.100-preview7-012821
16+ filePath : ' TestReadmeVersion.ps1'
17+ failOnStderr : true
1918
2019- task : DotNetCoreCLI@2
2120 displayName : Pack https
2726 packDirectory : $(build.ArtifactStagingDirectory)
2827 versioningScheme : byPrereleaseNumber
2928 majorVersion : 0
30- minorVersion : 1
31- patchVersion : 2
29+ minorVersion : 2
30+ patchVersion : 0
3231
3332- task : DotNetCoreCLI@2
3433 displayName : Test https
3736 projects : ' **/https.Tests.csproj'
3837
3938- task : PublishBuildArtifacts@1
39+ displayName : Upload Artifacts
4040 inputs :
4141 PathtoPublish : ' $(build.ArtifactStagingDirectory)'
4242 ArtifactName : ' https'
Original file line number Diff line number Diff line change 22
33 <PropertyGroup >
44 <OutputType >Exe</OutputType >
5- <TargetFramework >netcoreapp2.2 </TargetFramework >
5+ <TargetFramework >netcoreapp3.1 </TargetFramework >
66 <LangVersion >preview</LangVersion >
77 </PropertyGroup >
88
99 <PropertyGroup >
10- <VersionPrefix >0.1.2 </VersionPrefix >
10+ <VersionPrefix >0.2.0 </VersionPrefix >
1111 <VersionSuffix >local</VersionSuffix >
1212 </PropertyGroup >
1313
2525 <PackageReleaseNotes >https://github.com/joncloud/https/releases</PackageReleaseNotes >
2626 <!-- <PackageIconUrl>https://raw.githubusercontent.com/joncloud/https/master/nuget.png</PackageIconUrl>-->
2727 <PackageProjectUrl >https://github.com/joncloud/https</PackageProjectUrl >
28- <PackageLicenseUrl >https://raw.githubusercontent.com/joncloud/https/master/LICENSE.md</ PackageLicenseUrl >
28+ <PackageLicenseExpression >MIT</ PackageLicenseExpression >
2929 <RepositoryType >git</RepositoryType >
3030 <RepositoryUrl >https://github.com/joncloud/https</RepositoryUrl >
3131 </PropertyGroup >
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ namespace Https.Tests
66{
77 public class Startup
88 {
9- public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
9+ public void Configure ( IApplicationBuilder app )
1010 {
1111 app . UseMiddleware < RedirectMiddleware > ( ) ;
1212 app . UseMiddleware < MirrorMiddleware > ( ) ;
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >netcoreapp3.0 </TargetFramework >
4+ <TargetFramework >netcoreapp3.1 </TargetFramework >
55 <IsPackable >false</IsPackable >
66 <RootNamespace >Https.Tests</RootNamespace >
77 <LangVersion >preview</LangVersion >
88 </PropertyGroup >
99
1010 <ItemGroup >
11- <PackageReference Include =" Microsoft.AspNetCore" Version = " 2.2.0 " />
12- <PackageReference Include =" Microsoft.AspNetCore .Hosting" Version =" 2.2.0 " />
13- <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.2.0 " />
11+ <FrameworkReference Include =" Microsoft.AspNetCore.App " />
12+ <PackageReference Include =" Microsoft.Extensions .Hosting" Version =" 3.1.6 " />
13+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.6.1 " />
1414 <PackageReference Include =" xunit" Version =" 2.4.1" />
15- <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4.1 " >
15+ <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4.2 " >
1616 <PrivateAssets >all</PrivateAssets >
1717 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
1818 </PackageReference >
You can’t perform that action at this time.
0 commit comments