Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup nightly build #425

Merged
merged 2 commits into from
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<PackageOutputPath>$(MSBuildThisFileDirectory)build\$(Configuration)\</PackageOutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.38" PrivateAssets="all" />
</ItemGroup>
</Project>
14 changes: 13 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:
pool:
vmImage: 'windows-2019'
steps:
- task: DotNetCoreInstaller@0
inputs:
version: '2.2.300'
displayName: 'Install .NET Core SDK'
- script: dotnet msbuild build.proj /p:Configuration=$(buildConfiguration)
displayName: 'Run Build'

Expand All @@ -26,6 +30,10 @@ jobs:
pool:
vmImage: 'macOS-10.14'
steps:
- task: DotNetCoreInstaller@0
inputs:
version: '2.2.300'
displayName: 'Install .NET Core SDK'
- script: dotnet msbuild build.proj /p:Configuration=$(buildConfiguration)
displayName: 'Run Build'

Expand All @@ -41,5 +49,9 @@ jobs:
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DotNetCoreInstaller@0
inputs:
version: '2.2.300'
displayName: 'Install .NET Core SDK'
- script: dotnet msbuild build.proj /p:Configuration=$(buildConfiguration)
displayName: 'Run Build'
displayName: 'Run Build'
7 changes: 4 additions & 3 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
<OutputPath>$(MSBuildThisFileDirectory)build\$(Configuration)</OutputPath>
<PublicRelease Condition="$(PublicRelease) == ''">true</PublicRelease>
</PropertyGroup>

<Target Name="BuildAllProjects">
Expand Down Expand Up @@ -30,9 +31,9 @@
</Target>

<Target Name="CreateNuGetPackage" AfterTargets="RunTests" Condition="$(Configuration) == 'Release'">
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) -o $(OutputPath)" />
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.console\coverlet.console.csproj&quot; -c $(Configuration) -o $(OutputPath)" />
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.collector\coverlet.collector.csproj&quot; -c $(Configuration) -p:NuspecFile=&quot;$(MSBuildThisFileDirectory)src\coverlet.collector\coverlet.collector.nuspec&quot; -o $(OutputPath)" />
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.msbuild.tasks\coverlet.msbuild.tasks.csproj&quot; -c $(Configuration) -o $(OutputPath) /p:PublicRelease=$(PublicRelease)" />
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.console\coverlet.console.csproj&quot; -c $(Configuration) -o $(OutputPath) /p:PublicRelease=$(PublicRelease)" />
<Exec Command="dotnet pack &quot;$(MSBuildThisFileDirectory)src\coverlet.collector\coverlet.collector.csproj&quot; -c $(Configuration) -o $(OutputPath) /p:PublicRelease=$(PublicRelease)" />
</Target>

</Project>
12 changes: 12 additions & 0 deletions eng/azure-pipelines-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pool:
vmImage: 'windows-2019'
steps:
- task: DotNetCoreInstaller@0
inputs:
version: '2.2.300'
- powershell:
.\eng\nightly.ps1 -apiKey $env:APIKEY -source $env:SOURCE
ignoreLASTEXITCODE: "true"
env:
APIKEY: $(apikey)
SOURCE: $(source)
19 changes: 19 additions & 0 deletions eng/nightly.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
param (
[string]$apiKey,
[string]$source
)

if (!$apiKey -or !$source)
{
Write-Host -ForegroundColor Red Specify apiKey and source
exit
}

Write-Host -ForegroundColor Blue Publish with .NET CLI
& dotnet --info

Write-Host -ForegroundColor Green Create Packages
& dotnet msbuild "$PSScriptRoot\..\build.proj" /t:CreateNuGetPackage /p:Configuration=Release /p:PublicRelease=false # amend build.proj path if changes

Write-Host -ForegroundColor Green Upload Packages
& dotnet nuget push "$PSScriptRoot\..\build\Release\*.nupkg" -k $apiKey -s $source
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "2.2.300"
}
}
14 changes: 9 additions & 5 deletions src/coverlet.collector/coverlet.collector.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<Project Sdk="Microsoft.NET.Sdk" >
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyTitle>coverlet.collector</AssemblyTitle>
<AssemblyVersion>1.0.0</AssemblyVersion>

<PackageId>coverlet.collector</PackageId>
<PackageVersion>$(AssemblyVersion)</PackageVersion>
<Title>coverlet.collector</Title>
<Authors>tonerdo</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand All @@ -19,6 +15,7 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/tonerdo/coverlet</RepositoryUrl>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<NuspecFile>coverlet.collector.nuspec</NuspecFile>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -65,4 +62,11 @@
<ProjectReference Include="$(MSBuildThisFileDirectory)..\coverlet.core\coverlet.core.csproj" PrivateAssets="All" />
</ItemGroup>

<Target Name="SetNuspecPackageVersion" DependsOnTargets="GetBuildVersion" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<NuspecProperties>$(NuspecProperties);version=$(NuGetPackageVersion);configuration=$(Configuration)
</NuspecProperties>
</PropertyGroup>
</Target>

</Project>
6 changes: 3 additions & 3 deletions src/coverlet.collector/coverlet.collector.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>coverlet.collector</id>
<version>1.0.0</version>
<version>$version$</version>
<title>coverlet.collector</title>
<authors>tonerdo</authors>
<owners>tonerdo</owners>
Expand All @@ -14,8 +14,8 @@
<tags>coverage testing unit-test lcov opencover quality</tags>
</metadata>
<files>
<file src="bin\Release\netcoreapp2.0\*.dll" target="build\netcoreapp2.0\" />
<file src="bin\Release\netcoreapp2.0\coverlet.collector.deps.json" target="build\netcoreapp2.0\" />
<file src="bin\$configuration$\netcoreapp2.0\*.dll" target="build\netcoreapp2.0\" />
<file src="bin\$configuration$\netcoreapp2.0\coverlet.collector.deps.json" target="build\netcoreapp2.0\" />
<file src="coverlet.collector.targets" target="build\netcoreapp2.0\" />
</files>
</package>
7 changes: 7 additions & 0 deletions src/coverlet.collector/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0.0",
"publicReleaseRefSpec": [
"^refs/heads/master$"
]
}
2 changes: 0 additions & 2 deletions src/coverlet.console/coverlet.console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
<ToolCommandName>coverlet</ToolCommandName>
<PackAsTool>true</PackAsTool>
<AssemblyTitle>coverlet.console</AssemblyTitle>
<AssemblyVersion>1.5.1</AssemblyVersion>
<Authors>tonerdo</Authors>
<PackageId>$(AssemblyTitle)</PackageId>
<Title>$(AssemblyTitle)</Title>
<Description>Coverlet is a cross platform code coverage tool for .NET, with support for line, branch and method coverage.</Description>
<PackageVersion>$(AssemblyVersion)</PackageVersion>
<PackageTags>coverage;testing;unit-test;lcov;opencover;quality</PackageTags>
Expand Down
7 changes: 7 additions & 0 deletions src/coverlet.console/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.5.1",
"publicReleaseRefSpec": [
"^refs/heads/master$"
]
}
3 changes: 0 additions & 3 deletions src/coverlet.msbuild.tasks/coverlet.msbuild.tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
<OutputType>Library</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyTitle>coverlet.msbuild.tasks</AssemblyTitle>
<AssemblyVersion>2.6.1</AssemblyVersion>

<PackageId>coverlet.msbuild</PackageId>
<PackageVersion>$(AssemblyVersion)</PackageVersion>
<Title>coverlet.msbuild</Title>
<Authors>tonerdo</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
7 changes: 7 additions & 0 deletions src/coverlet.msbuild.tasks/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "2.6.1",
"publicReleaseRefSpec": [
"^refs/heads/master$"
]
}