-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert release script to Powershell
Also, generate documentation with Sandcastle Help File Builder.
- Loading branch information
Showing
4 changed files
with
186 additions
and
122 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
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,105 @@ | ||
$ErrorActionPreference = 'Stop' | ||
$DebugPreference = 'Continue' | ||
|
||
$projectJsonFile=(Get-Item "MaxMind.MinFraud/project.json").FullName | ||
$matches = (Get-Content -Encoding UTF8 releasenotes.md) ` | | ||
Select-String '(\d+\.\d+\.\d+(?:-\w+)?) \((\d{4}-\d{2}-\d{2})\)' ` | ||
|
||
$version = $matches.Matches.Groups[1].Value | ||
$date = $matches.Matches.Groups[2].Value | ||
|
||
if((Get-Date -format 'yyyy-MM-dd') -ne $date ) { | ||
Write-Error "$date is not today!" | ||
exit 1 | ||
} | ||
|
||
$tag = "v$version" | ||
|
||
if (& git status --porcelain) { | ||
Write-Error '. is not clean' | ||
} | ||
|
||
# Not using Powershell's built-in JSON support as that | ||
# reformats the file. | ||
(Get-Content -Encoding UTF8 $projectJsonFile) ` | ||
-replace '(?<=version"\s*:\s*")[^"]+', $version ` | | ||
Out-File -Encoding UTF8 $projectJsonFile | ||
|
||
|
||
& git diff | ||
|
||
if ((Read-Host -Prompt 'Continue? (y/n)') -ne 'y') { | ||
Write-Error 'Aborting' | ||
} | ||
|
||
if (-Not(& git status --porcelain)) { | ||
& git add $projectJsonFile | ||
& git commit -m "Prepare for $version" | ||
} | ||
|
||
Push-Location MaxMind.MinFraud | ||
|
||
& dotnet restore | ||
& dotnet build -c Release | ||
& dotnet pack -c Release | ||
|
||
Pop-Location | ||
|
||
Push-Location MaxMind.MinFraud.UnitTest | ||
|
||
& dotnet restore | ||
& dotnet test -c Release | ||
|
||
Pop-Location | ||
|
||
if ((Read-Host -Prompt 'Continue given tests? (y/n)') -ne 'y') { | ||
Write-Error 'Aborting' | ||
} | ||
|
||
if (Test-Path .gh-pages ) { | ||
Write-Debug "Updating .gh-pages" | ||
Push-Location .gh-pages | ||
& git pull | ||
} else { | ||
Write-Debug "Checking out gh-pages in .gh-pages" | ||
& git clone -b gh-pages git@github.com:maxmind/minfraud-api-dotnet.git .gh-pages | ||
Push-Location .gh-pages | ||
} | ||
|
||
if (& git status --porcelain) { | ||
Write-Error '.gh-pages is not clean' | ||
} | ||
Pop-Location | ||
|
||
$page = '.gh-pages\index.md' | ||
|
||
@" | ||
--- | ||
layout: default | ||
title: MaxMind minFraud Score and Insights .NET API | ||
language: dotnet | ||
version: $tag | ||
--- | ||
"@ | Out-File -Encoding UTF8 -Append $page | ||
|
||
Get-Content -Encoding UTF8 'README.md' | Out-File -Encoding UTF8 -Append $page | ||
|
||
& MSBuild.exe .\minfraud.shfbproj /p:OutputPath=.gh-pages\doc\$tag | ||
|
||
Push-Location .gh-pages | ||
|
||
& git add doc/ | ||
& git commit -m "Updated for $tag" -a | ||
|
||
if ((Read-Host -Prompt 'Should push? (y/n)') -ne 'y') { | ||
Write-Error 'Aborting' | ||
} | ||
|
||
& git push | ||
|
||
Pop-Location | ||
& git tag "$tag" | ||
& git push | ||
& git push --tags | ||
|
||
& nuget push "MaxMind.MinFraud/bin/Release/MaxMind.MinFraud.$version.nupkg" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<!-- The configuration and platform will be used to determine which assemblies to include from solution and | ||
project documentation sources --> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{5c4e3997-080a-4de1-a850-ea1e14543cb5}</ProjectGuid> | ||
<SHFBSchemaVersion>2015.6.5.0</SHFBSchemaVersion> | ||
<!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual Studio adds them anyway --> | ||
<AssemblyName>Documentation</AssemblyName> | ||
<RootNamespace>Documentation</RootNamespace> | ||
<Name>Documentation</Name> | ||
<!-- SHFB properties --> | ||
<FrameworkVersion>.NET Framework 4.5</FrameworkVersion> | ||
<OutputPath>Help\</OutputPath> | ||
<HtmlHelpName>Documentation</HtmlHelpName> | ||
<Language>en-US</Language> | ||
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity> | ||
<HelpFileFormat>Website</HelpFileFormat> | ||
<IndentHtml>False</IndentHtml> | ||
<KeepLogFile>True</KeepLogFile> | ||
<DisableCodeBlockComponent>False</DisableCodeBlockComponent> | ||
<CleanIntermediates>True</CleanIntermediates> | ||
<DocumentationSources> | ||
<DocumentationSource sourceFile="MaxMind.MinFraud\bin\Release\net45\MaxMind.MinFraud.xml" /> | ||
<DocumentationSource sourceFile="MaxMind.MinFraud\bin\Release\net45\MaxMind.MinFraud.dll" /> | ||
<DocumentationSource sourceFile="..\GeoIP2-dotnet\GeoIP2\bin\Release\net45\MaxMind.GeoIP2.dll" /> | ||
<DocumentationSource sourceFile="..\GeoIP2-dotnet\GeoIP2\bin\Release\net45\MaxMind.GeoIP2.xml" /> | ||
<DocumentationSource sourceFile="..\MaxMind-DB-Reader-dotnet\MaxMind.Db\bin\Release\net45\MaxMind.Db.dll" /> | ||
<DocumentationSource sourceFile="..\MaxMind-DB-Reader-dotnet\MaxMind.Db\bin\Release\net45\MaxMind.Db.xml" /></DocumentationSources> | ||
<HelpFileVersion>1.0.0.0</HelpFileVersion> | ||
<MaximumGroupParts>2</MaximumGroupParts> | ||
<NamespaceGrouping>True</NamespaceGrouping> | ||
<SyntaxFilters>Standard</SyntaxFilters> | ||
<SdkLinkTarget>Blank</SdkLinkTarget> | ||
<RootNamespaceContainer>True</RootNamespaceContainer> | ||
<PresentationStyle>VS2013</PresentationStyle> | ||
<Preliminary>False</Preliminary> | ||
<NamingMethod>MemberName</NamingMethod> | ||
<HelpTitle>MaxMind.MinFraud Library</HelpTitle> | ||
<ContentPlacement>AboveNamespaces</ContentPlacement> | ||
</PropertyGroup> | ||
<!-- There are no properties for these groups. AnyCPU needs to appear in order for Visual Studio to perform | ||
the build. The others are optional common platform types that may appear. --> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' "> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' "> | ||
</PropertyGroup> | ||
<!-- Import the SHFB build targets --> | ||
<Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" /> | ||
<!-- The pre-build and post-build event properties must appear *after* the targets file import in order to be | ||
evaluated correctly. --> | ||
<PropertyGroup> | ||
<PreBuildEvent> | ||
</PreBuildEvent> | ||
<PostBuildEvent> | ||
</PostBuildEvent> | ||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="MaxMind.MinFraud\MaxMind.MinFraud.xproj"> | ||
<Name>MaxMind.MinFraud</Name> | ||
<Project>7208D9C8-F862-4675-80E5-77A2F8901B96</Project> | ||
</ProjectReference> | ||
</ItemGroup> | ||
</Project> |