summary refs log tree commit diff
diff options
context:
space:
mode:
authorOren Novotny <oren@novotny.org>2018-05-19 16:46:29 -0400
committerOren Novotny <oren@novotny.org>2018-05-19 16:49:05 -0400
commitf5ea2cd95d719c0aa957937725f2057362bd0c01 (patch)
tree81907d77c15b8f935f20ab16ffc67b56b8cf85fb
parentUpdate NuGet packaging info (diff)
downloadBouncyCastle.NET-ed25519-f5ea2cd95d719c0aa957937725f2057362bd0c01.tar.xz
Versioning (#8)
* Add VSTS build artifacts

* test commit

* use four part version
-rw-r--r--.vsts-ci.yml19
-rw-r--r--.vsts-pr.yml5
-rw-r--r--.vsts-shared.yml46
-rw-r--r--GitVersionConfig.yaml13
-rw-r--r--crypto/src/crypto.csproj13
-rw-r--r--scripts/Sign-Package.ps11
-rw-r--r--scripts/setversion.csproj20
-rw-r--r--scripts/version.json8
-rw-r--r--version.json16
9 files changed, 126 insertions, 15 deletions
diff --git a/.vsts-ci.yml b/.vsts-ci.yml
new file mode 100644
index 000000000..63f102462
--- /dev/null
+++ b/.vsts-ci.yml
@@ -0,0 +1,19 @@
+trigger:
+- netstandard
+- rel/*
+
+queue: Hosted VS2017
+variables: 
+  BuildConfiguration: Release
+steps:
+- template: .vsts-shared.yml
+  parameters:
+    signSteps:
+    - task: PowerShell@2
+      displayName: Authenticode Sign artifacts
+      inputs:
+        filePath: scripts/Sign-Package.ps1
+      env:
+        SignClientUser: $(SignClientUser)
+        SignClientSecret: $(SignClientSecret)
+        ArtifactDirectory: $(Build.ArtifactStagingDirectory)\Packages
diff --git a/.vsts-pr.yml b/.vsts-pr.yml
new file mode 100644
index 000000000..d1262cb2b
--- /dev/null
+++ b/.vsts-pr.yml
@@ -0,0 +1,5 @@
+queue: Hosted VS2017
+variables: 
+  BuildConfiguration: Release
+steps:
+- template: .vsts-shared.yml
\ No newline at end of file
diff --git a/.vsts-shared.yml b/.vsts-shared.yml
new file mode 100644
index 000000000..96da016a7
--- /dev/null
+++ b/.vsts-shared.yml
@@ -0,0 +1,46 @@
+parameters: 
+  signSteps: []
+  
+steps:
+- task: BatchScript@1
+  inputs:
+    filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
+    arguments: -no_logo
+    modifyEnvironment: true
+  displayName: Setup Environment Variables
+
+- task: NuGetToolInstaller@0
+  displayName: Use NuGet 4.7.0
+  inputs:
+    versionSpec: 4.7.0
+
+- task: DotNetCoreCLI@2
+  inputs:
+    command: build
+    projects: scripts/setversion.csproj
+    arguments: -c $(BuildConfiguration)   
+  displayName: Set Version
+  condition: eq(variables['system.pullrequest.isfork'], false)
+
+- powershell: |        
+    mkdir $(Build.ArtifactStagingDirectory)\Packages
+    msbuild .\crypto\src\crypto.csproj /restore /m /t:pack /p:Configuration=$(BuildConfiguration) /p:PackageId="Portable.BouncyCastle" /p:PackageOutputPath=$(Build.ArtifactStagingDirectory)\Packages
+  
+  displayName: Build
+  
+- task: DotNetCoreCLI@2
+  inputs:
+    command: test
+    projects: .\crypto\test\crypto.test.csproj
+    arguments: -c $(BuildConfiguration) --no-build --no-restore
+  displayName: Run Tests
+  
+- ${{ parameters.signSteps }}
+
+- task: PublishBuildArtifacts@1
+  displayName: Publish Package Artifacts
+  inputs:
+    pathToPublish: $(Build.ArtifactStagingDirectory)\Packages
+    artifactType: container
+    artifactName: Packages
+  condition: eq(variables['system.pullrequest.isfork'], false)
diff --git a/GitVersionConfig.yaml b/GitVersionConfig.yaml
deleted file mode 100644
index ba842addb..000000000
--- a/GitVersionConfig.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-tag-prefix: 'pcl-[vV]'
-legacy-semver-padding: 0
-branches:
-  pcl:
-    mode: ContinuousDeployment    
-    tag: beta
-    increment: Inherit
-    regex: pcl
-  netstandard:
-    mode: ContinuousDeployment    
-    tag: beta
-    increment: Inherit
-    regex: netstandard
\ No newline at end of file
diff --git a/crypto/src/crypto.csproj b/crypto/src/crypto.csproj
index 7d0be0b19..bb3de0c9c 100644
--- a/crypto/src/crypto.csproj
+++ b/crypto/src/crypto.csproj
@@ -1,4 +1,4 @@
-<Project Sdk="MSBuild.Sdk.Extras/1.3.1">
+<Project Sdk="MSBuild.Sdk.Extras/1.5.4">
   <PropertyGroup>
     <TargetFrameworks>netstandard2.0;netstandard1.3;netstandard1.0;portable-net4+sl5+wp8+win8+wpa81;net4</TargetFrameworks>
     <AssemblyName>BouncyCastle.Crypto</AssemblyName>
@@ -40,7 +40,16 @@
   <ItemGroup>
     <Compile Include="..\bzip2\src\**\*.cs" LinkBase="bzip2" />
     <None Include="..\..\BouncyCastle.snk" />
-    <PackageReference Include="GitVersionTask" Version="4.0.0-beta0011" PrivateAssets="All" />
+    <PackageReference Include="NerdBank.GitVersioning" Version="2.1.23" PrivateAssets="All" />
     <PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.0" PrivateAssets="All" />
   </ItemGroup>
+  
+  <Target Name="SetBuildVer" AfterTargets="GetBuildVersion" BeforeTargets="SetCloudBuildVersionVars;SetCloudBuildNumberWithVersion">
+    <PropertyGroup>
+      <CloudBuildNumber>$(BuildVersion)</CloudBuildNumber>
+      <Version>$(BuildVersion)</Version>
+      <PackageVersion>$(BuildVersion)</PackageVersion>
+      <NuGetPackageVersion>$(BuildVersion)</NuGetPackageVersion>
+    </PropertyGroup>
+  </Target>
 </Project>
\ No newline at end of file
diff --git a/scripts/Sign-Package.ps1 b/scripts/Sign-Package.ps1
index f38b5227e..e68e5375d 100644
--- a/scripts/Sign-Package.ps1
+++ b/scripts/Sign-Package.ps1
@@ -6,6 +6,7 @@ if([string]::IsNullOrEmpty($env:SignClientSecret)){
 	return;
 }
 
+& nuget install SignClient -Version 0.9.1 -SolutionDir "$currentDirectory\..\" -Verbosity quiet -ExcludeVersion
 # Setup Variables we need to pass into the sign client tool
 
 $appSettings = "$currentDirectory\SignClient.json"
diff --git a/scripts/setversion.csproj b/scripts/setversion.csproj
new file mode 100644
index 000000000..25f6bb43e
--- /dev/null
+++ b/scripts/setversion.csproj
@@ -0,0 +1,20 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>netstandard2.0</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.23" PrivateAssets="all" />
+  </ItemGroup>
+
+
+  <Target Name="SetBuildVer" AfterTargets="GetBuildVersion" BeforeTargets="SetCloudBuildVersionVars;SetCloudBuildNumberWithVersion">
+    <PropertyGroup>
+      <CloudBuildNumber>$(BuildVersion)</CloudBuildNumber>
+      <Version>$(BuildVersion)</Version>
+      <PackageVersion>$(BuildVersion)</PackageVersion>
+      <NuGetPackageVersion>$(BuildVersion)</NuGetPackageVersion>
+    </PropertyGroup>
+  </Target>
+</Project>
diff --git a/scripts/version.json b/scripts/version.json
new file mode 100644
index 000000000..f1b52a7dc
--- /dev/null
+++ b/scripts/version.json
@@ -0,0 +1,8 @@
+{
+  "inherit": true,
+  "cloudBuild": {
+    "buildNumber": {
+      "enabled": true
+    }
+  }
+}
diff --git a/version.json b/version.json
new file mode 100644
index 000000000..79bc756b4
--- /dev/null
+++ b/version.json
@@ -0,0 +1,16 @@
+{
+  "version": "1.8.2",
+  "publicReleaseRefSpec": [
+    "^refs/heads/master$", // we release out of master
+    "^refs/heads/netstandard$", // we release out of netstandard
+    "^refs/heads/ref/v\\d+\\.\\d+" // we also release tags starting with ref/vN.N 
+  ],
+  "nugetPackageVersion":{
+    "semVer": 2
+  },
+  "cloudBuild": {
+    "buildNumber": {
+      "enabled": false
+    }
+  }
+}