Skip to content

Sholtee/build

Repository files navigation

How to use

Pre requirements

Access tokens

To work properly you need to create some access tokens and secure them:

  • GitHub: only the repo scope required
  • A Coveralls repo_token (you get it during the repo registration)
  • A NuGet API key

In the followings you MUST use the SECURED values of the tokens above

Setup your project

  • Create the appveyor.yml file in your project root from the template. You should modify only the values of the environment variables (marked with xXx in the sample).
  • Create the project.json file in your project root from the template. Your project should consist of an app project, a tests project and a perftests project.
  • Add/merge the followings to the csproj of your project (under the Project node):
    <PropertyGroup>
      <TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
      <Company>Your Company</Company>
      <Authors>Your Name</Authors>
      <Version>1.0.0-preview1</Version>
      <AssemblyName>YourProject</AssemblyName>
    </PropertyGroup>
    
    <ItemGroup>
      <None Remove="docfx.json" />
      <None Remove="index.md" />
      <None Include="path\to\icon.png" Pack="true" PackagePath=""/>
    </ItemGroup>
    
    <PropertyGroup>
      <DocumentationFile>..\BIN\YourProject.xml</DocumentationFile>
      <Product>...</Product>  
      <Description>...</Description>
      <PackageId>...</PackageId>
      <PackageLicenseExpression>MIT</PackageLicenseExpression>
      <PackageIcon>icon.png</PackageIcon>
      <PackageTags>...;...;...;</PackageTags>
      <PackageReleaseNotes>See homepage.</PackageReleaseNotes>
    </PropertyGroup>  
  • Copy the docfx.json and index.md to the source folder of your project (SRC by default). In docfx.json modify csproj name and title, in index.md modify the URLs.
  • Add/merge the followings to the csproj of your test project (under the Project node):
    <PropertyGroup>
      <TargetFrameworks>net5.0</TargetFrameworks>
      <IsPackable>false</IsPackable>
      <IsTestProject>true</IsTestProject>
      <AssemblyName>YourProject.Tests</AssemblyName>
      <RootNamespace>YourProject.Tests</RootNamespace>
      <Configurations>Debug</Configurations>
      <OutputType>Library</OutputType>
    </PropertyGroup>
    
    <ItemGroup>
      <PackageReference Include="nunit" Version="3.*" />
      <PackageReference Include="NUnit3TestAdapter" Version="3.*" />
      <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.*" />
      <PackageReference Include="NunitXml.TestLogger" Version="3.*" />
    </ItemGroup> 
  • Add/merge the followings to the csproj of your benchmark project (under the Project node):
    <PropertyGroup>
      <OutputType>Exe</OutputType>
      <IsPackable>false</IsPackable>
      <TargetFramework>net5.0</TargetFramework>
      <AssemblyName>YourProject.Perf</AssemblyName>
    </PropertyGroup>
    
    <ItemGroup>
      <None Remove="docfx.json" />
      <None Remove="index.md" />
    </ItemGroup>
    
    <ItemGroup>
      <PackageReference Include="BenchmarkDotNet" Version="0.12.*" />
      <PackageReference Condition="'$(LibVersion)' != ''" Include="YourProjectId" Version="$(LibVersion)"></PackageReference>
    </ItemGroup>
    
    <ItemGroup>
      <ProjectReference Condition="'$(LibVersion)' == ''" Include="..\SRC\YourProject.csproj" />
    </ItemGroup>
  • Copy the docfx.json and index.md to the source folder of your benchmark project (PERF by default). In index.md modify the URLs.
  • GitIgnore the Artifacts folder in your project root.
  • GitIgnore manifest.json on your gh-pages branch.
  • Create an index.html on your gh-pages branch:
    <!DOCTYPE html>
    <html>
      <head>
        <meta http-equiv="Refresh" content="0; url=https://YourName.github.io/YourProject/doc/">
      </head>
    </html>  
  • Create a project icon (named icon.png) in your project root.

Artifacts

Will be placed on your gh-pages branch under the doc and perf folder

Add status badges (to your README.MD)

Using

  • Regular tests are done on every branch on every commit
  • Performance tests are done on perf tag but results are publishd only if the tag was placed on a master branch commit
  • API docs are updated and publishd on every master branch commit
  • NuGet package is deployed on version tags (e.g. v1.0.0-preview1) placed on a master branch commit

About

Repository of my CI/CD scripts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published