Skip to content

Commit

Permalink
v2.0.0 Template Release (#229)
Browse files Browse the repository at this point in the history
* Upgrade to GitHub-native Dependabot

* Bump src/templates/Petabridge.App from `65cc71b` to `6e1524a` (#205)

Bumps [src/templates/Petabridge.App](https://github.com/petabridge/Petabridge.App) from `65cc71b` to `6e1524a`.
- [Release notes](https://github.com/petabridge/Petabridge.App/releases)
- [Commits](petabridge/Petabridge.App@65cc71b...6e1524a)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Merge pull request #204 from petabridge/dependabot/submodules/src/templates/Petabridge.WebApp-96af934

Bump src/templates/Petabridge.WebApp from `237237e` to `96af934`

* Bump src/templates/Petabridge.App from `6e1524a` to `e86e40c` (#206)

Bumps [src/templates/Petabridge.App](https://github.com/petabridge/Petabridge.App) from `6e1524a` to `e86e40c`.
- [Release notes](https://github.com/petabridge/Petabridge.App/releases)
- [Commits](petabridge/Petabridge.App@6e1524a...e86e40c)

---
updated-dependencies:
- dependency-name: src/templates/Petabridge.App
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump src/templates/Petabridge.Library from `ab5a07f` to `e6dce88` (#207)

Bumps [src/templates/Petabridge.Library](https://github.com/petabridge/Petabridge.Library) from `ab5a07f` to `e6dce88`.
- [Release notes](https://github.com/petabridge/Petabridge.Library/releases)
- [Commits](petabridge/Petabridge.Library@ab5a07f...e6dce88)

---
updated-dependencies:
- dependency-name: src/templates/Petabridge.Library
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump src/templates/Petabridge.WebApp from `96af934` to `de91070` (#227)

Bumps [src/templates/Petabridge.WebApp](https://github.com/petabridge/Petabridge.App.Web) from `96af934` to `de91070`.
- [Release notes](https://github.com/petabridge/Petabridge.App.Web/releases)
- [Commits](petabridge/Petabridge.App.Web@96af934...de91070)

---
updated-dependencies:
- dependency-name: src/templates/Petabridge.WebApp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump src/templates/Petabridge.App from `e86e40c` to `f29987c` (#226)

Bumps [src/templates/Petabridge.App](https://github.com/petabridge/Petabridge.App) from `e86e40c` to `f29987c`.
- [Release notes](https://github.com/petabridge/Petabridge.App/releases)
- [Commits](petabridge/Petabridge.App@e86e40c...f29987c)

---
updated-dependencies:
- dependency-name: src/templates/Petabridge.App
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump src/templates/Petabridge.Library from `e6dce88` to `d3c3460` (#225)

Bumps [src/templates/Petabridge.Library](https://github.com/petabridge/Petabridge.Library) from `e6dce88` to `d3c3460`.
- [Release notes](https://github.com/petabridge/Petabridge.Library/releases)
- [Commits](petabridge/Petabridge.Library@e6dce88...d3c3460)

---
updated-dependencies:
- dependency-name: src/templates/Petabridge.Library
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update build.fsx (#228)

* update build.fsx

* update release notes

* update README

* fix README

* Fix template layout

* update README

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ebere Abanonu <eaba@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 17, 2022
2 parents ec0940a + 03a1a5c commit 35497e0
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 113 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: gitsubmodule
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ This will download the latest available [Petabridge.Templates package from NuGet
After the installation process is complete, you'll see all of the templates included in the Petabridge.Templates package listed in your set of available templates if you execute the `dotnet new -l` command:

```
Templates Short Name Language Tags
--------------------------------------------------------------------------------------
Console Application console [C#], F# Common/Console
Class library classlib [C#], F# Common/Library
Petabridge .NET Core Library pb-lib [C#] Petabridge/DocFx/Tests
Unit Test Project mstest [C#], F# Test/MSTest
xUnit Test Project xunit [C#], F# Test/xUnit
ASP.NET Core Empty web [C#] Web/Empty
ASP.NET Core Web App mvc [C#], F# Web/MVC
ASP.NET Core Web API webapi [C#] Web/WebAPI
Solution File sln Solution
Template Name Short Name Language Tags
-------------------------------------------------- ------------------- ---------- --------------------------
Class Library classlib [C#],F#,VB Common/Library
Console App console [C#],F#,VB Common/Console
Petabridge .NET Core Library pb-lib [C#] Petabridge/DocFx/Tests
Petabridge Akka.Cluster Starter App pb-akka-cluster [C#] Petabridge/DocFx/Tests
Petabridge ASP.NET Core + Akka.Cluster Starter App pb-akka-web [C#] Petabridge/DocFx/Tests
```

To uninstall the package, use the following command:
Expand All @@ -47,8 +43,8 @@ The following templates are installed as part of your `Petabridge.Templates` ins
| Template Name | Short Name | Description |
|:------------------:|------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| [Petabridge.Library](https://github.com/petabridge/Petabridge.Library/) | pb-lib | A professional .NET Core project setup including build scripts, documentation, unit tests, and performance tests for a class library project. |
| [Petabridge.App](https://github.com/petabridge/Petabridge.App/) | pb-akka-cluster | Creates a headless .NET Core 3.0 service that includes full [Akka.NET](https://getakka.net/) clustering support, Docker support, documentation, and build systems. |
| [Petabridge.App.Web](https://github.com/petabridge/Petabridge.App.Web) | pb-akka-web | Does the same as `pb-akka-cluster`, but hosts [Akka.NET](https://getakka.net/) inside an ASP.NET Core 3.0 simple web application. |
| [Petabridge.App](https://github.com/petabridge/Petabridge.App/) | pb-akka-cluster | Creates a headless .NET 6 service that includes full [Akka.NET](https://getakka.net/) clustering support, Docker support, documentation, and build systems. |
| [Petabridge.App.Web](https://github.com/petabridge/Petabridge.App.Web) | pb-akka-web | Does the same as `pb-akka-cluster`, but hosts [Akka.NET](https://getakka.net/) inside an ASP.NET Core 6 simple web application. |


You can read more about how these templates work by clicking on their titles and reading the `README.md` for each individual project.
Expand All @@ -62,15 +58,22 @@ C:\> dotnet new pb-lib [-n name] [other arguments]
So for instance, if I execute `dotnet new pb-lib -n "MyProject"` the following output will appear in my working directory:

```
D:\MyProject\.nuke
D:\MyProject\build.cmd
D:\MyProject\build.fsx
D:\MyProject\build.ps1
D:\MyProject\build.sh
D:\MyProject\docs
D:\MyProject\MyProject.sln
D:\MyProject\README.md
D:\MyProject\RELEASE_NOTES.md
D:\MyProject\src
D:\MyProject\CHANGELOG.md
D:\MyProject\gitversion.yml
D:\MyProject\build
D:\MyProject\build\_build.csproj
D:\MyProject\build\Build.CI.GitHubActions.cs
D:\MyProject\build\Build.cs
D:\MyProject\build\Configuration.cs
D:\MyProject\build\Directory.Build.props
D:\MyProject\build\Directory.Build.targets
D:\MyProject\docs
D:\MyProject\docs\api
D:\MyProject\docs\articles
D:\MyProject\docs\docfx.json
Expand All @@ -81,7 +84,8 @@ D:\MyProject\docs\api\index.md
D:\MyProject\docs\articles\index.md
D:\MyProject\docs\articles\toc.yml
D:\MyProject\docs\images\icon.png
D:\MyProject\src\common.props
D:\MyProject\src
D:\MyProject\src\Directory.Build.props
D:\MyProject\src\MyProject
D:\MyProject\src\MyProject.Tests
D:\MyProject\src\MyProject.Tests.Performance
Expand All @@ -93,7 +97,7 @@ D:\MyProject\src\MyProject.Tests.Performance\MyProject.Tests.Performance.csproj
D:\MyProject\src\MyProject.Tests.Performance\UnitTest1.cs
```

I'll have a new .NET Standard library project complete with a cross-platform build system, documentation, unit tests, performance tests, and a README explaining how all of the above work ready to go from day one.
I'll have a new .NET 6 library project complete with a cross-platform build system, documentation, unit tests, performance tests, and a README explaining how all of the above work ready to go from day one.

See [the official `dotnet new` documentation](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new) for more information on the sorts of options that are available when using project templates.

Expand All @@ -109,4 +113,4 @@ We accept pull requests! Please let us know what we can do to make these templat
Petabridge provides [Akka.NET](http://getakka.net/) consulting, training, and support including advanced training in [Akka.Remote](https://petabridge.com/training/akka-remoting/), [Akka.Cluster](https://petabridge.com/training/akka-clustering/), and [Akka.NET Design Patterns](https://petabridge.com/training/akka-design-patterns/)!

---
Copyright 2015 - 2019 Petabridge® All rights reserved.
Copyright 2015 - 2022 Petabridge® All rights reserved.
8 changes: 8 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#### 2.0.0 February 21 2022 ####

- Switched build automation system from FAKE to [NUKE](https://nuke.build/)
- Upgraded [pb-lib](https://github.com/petabridge/Petabridge.Library/), [`pb-akka-cluster`](https://github.com/petabridge/Petabridge.App) and [`pb-akka-web`](https://github.com/petabridge/Petabridge.App.Web) to all use .NET 6
- Replaced `common.props` with `Directory.Build.props`
- Git versioning with [GitVersion](https://gitversion.net/)
- Added README to NuGet Package

#### 1.2.0 April 15 2021 ####

- Upgraded [`pb-akka-cluster`](https://github.com/petabridge/Petabridge.App) and [`pb-akka-web`](https://github.com/petabridge/Petabridge.App.Web) to both use .NET 5
Expand Down
88 changes: 29 additions & 59 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ Param(
[string[]]$ScriptArgs
)

$FakeVersion = "4.61.2"
$DotNetChannel = "LTS";
$DotNetVersion = "2.1.500";
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/v$DotNetVersion/scripts/obtain/dotnet-install.ps1";
$NugetVersion = "4.1.0";
$FakeVersion = "4.63.0"
$NugetVersion = "5.8.0";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
$ProtobufVersion = "3.4.0"
$DocfxVersion = "2.40.5"
$ProtobufVersion = "3.13.0"
$DocfxVersion = "2.58.9"

$IncrementalistVersion = "0.6.0";

# Make sure tools folder exists
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
Expand All @@ -46,49 +45,6 @@ if (!(Test-Path $ToolPath)) {
New-Item -Path $ToolPath -Type directory | out-null
}

###########################################################################
# INSTALL .NET CORE CLI
###########################################################################

Function Remove-PathVariable([string]$VariableToRemove)
{
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
if ($path -ne $null)
{
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
}

$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
if ($path -ne $null)
{
$newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
}
}

# Get .NET Core CLI path if installed.
$FoundDotNetCliVersion = $null;
if (Get-Command dotnet -ErrorAction SilentlyContinue) {
$FoundDotNetCliVersion = dotnet --version;
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
}

if($FoundDotNetCliVersion -ne $DotNetVersion) {
$InstallPath = Join-Path $PSScriptRoot ".dotnet"
if (!(Test-Path $InstallPath)) {
mkdir -Force $InstallPath | Out-Null;
}
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath\dotnet-install.ps1");
& $InstallPath\dotnet-install.ps1 -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath -Architecture x64;

Remove-PathVariable "$InstallPath"
$env:PATH = "$InstallPath;$env:PATH"
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
}

###########################################################################
# INSTALL NUGET
###########################################################################
Expand All @@ -114,6 +70,20 @@ if (!(Test-Path $FakeExePath)) {
}
}

###########################################################################
# Google.Protobuf.Tools
###########################################################################

# Make sure Google.Protobuf.Tools has been installed.
$ProtobufExePath = Join-Path $ToolPath "Google.Protobuf.Tools/tools/windows_x64/protoc.exe"
if (!(Test-Path $ProtobufExePath)) {
Write-Host "Installing Google.Protobuf.Tools..."
Invoke-Expression "&`"$NugetPath`" install Google.Protobuf.Tools -ExcludeVersion -Version $ProtobufVersion -OutputDirectory `"$ToolPath`"" | Out-Null;
if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring Google.Protobuf.Tools from NuGet."
}
}

###########################################################################
# Docfx
###########################################################################
Expand All @@ -129,17 +99,17 @@ if (!(Test-Path $DocfxExePath)) {
}

###########################################################################
# SignTool
# Incrementalist
###########################################################################

# Make sure the SignClient has been installed
if (Get-Command signclient -ErrorAction SilentlyContinue) {
Write-Host "Found SignClient. Skipping install."
# Make sure the Incrementalist has been installed
if (Get-Command incrementalist -ErrorAction SilentlyContinue) {
Write-Host "Found Incrementalist. Skipping install."
}
else{
$SignClientFolder = Join-Path $ToolPath "signclient"
Write-Host "SignClient not found. Installing to ... $SignClientFolder"
dotnet tool install SignClient --version 1.0.82 --tool-path "$SignClientFolder"
$IncrementalistFolder = Join-Path $ToolPath "incrementalist"
Write-Host "Incrementalist not found. Installing to ... $IncrementalistFolder"
dotnet tool install Incrementalist.Cmd --version $IncrementalistVersion --tool-path "$IncrementalistFolder"
}

###########################################################################
Expand All @@ -156,6 +126,6 @@ $Arguments = @{

# Start Fake
Write-Host "Running build script..."
Invoke-Expression "$FakeExePath `"build.fsx`" $ScriptArgs $Arguments"

Invoke-Expression "& `"$FakeExePath`" `"build.fsx`" $ScriptArgs $Arguments"
exit $LASTEXITCODE
38 changes: 12 additions & 26 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
# Define directories.
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
SIGNCLIENT_DIR=$TOOLS_DIR/signclient
INCREMENTALIST_DIR=$TOOLS_DIR/incrementalist
INCREMENTALIST_EXE=$INCREMENTALIST_DIR/Incrementalist.Cmd.exe
NUGET_EXE=$TOOLS_DIR/nuget.exe
NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe
FAKE_VERSION=4.61.2
NUGET_URL=https://dist.nuget.org/win-x86-commandline/v5.8.0/nuget.exe
FAKE_VERSION=4.63.0
FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe
DOTNET_VERSION=2.1.500
DOTNET_INSTALLER_URL=https://raw.githubusercontent.com/dotnet/cli/v$DOTNET_VERSION/scripts/obtain/dotnet-install.sh
DOTNET_CHANNEL=LTS;
DOCFX_VERSION=2.40.5
DOCFX_EXE=$TOOLS_DIR/docfx.console/tools/docfx.exe
DOTNET_EXE=$SCRIPT_DIR/.dotnet/dotnet
DOTNETCORE_VERSION=3.1.105
DOTNET_VERSION=5.0.101
DOTNET_INSTALLER_URL=https://dot.net/v1/dotnet-install.sh
DOTNET_CHANNEL=LTS
PROTOBUF_VERSION=3.4.0
INCREMENTALIST_VERSION=0.6.0

# Define default arguments.
TARGET="Default"
Expand All @@ -42,23 +45,6 @@ if [ ! -d "$TOOLS_DIR" ]; then
mkdir "$TOOLS_DIR"
fi

###########################################################################
# INSTALL .NET CORE CLI
###########################################################################

echo "Installing .NET CLI..."
if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
mkdir "$SCRIPT_DIR/.dotnet"
fi
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" $DOTNET_INSTALLER_URL
bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version $DOTNET_VERSION --channel $DOTNET_CHANNEL --install-dir .dotnet --no-path
export PATH="$SCRIPT_DIR/.dotnet":$PATH
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
chmod -R 0755 ".dotnet"
"$SCRIPT_DIR/.dotnet/dotnet" --info


###########################################################################
# INSTALL NUGET
###########################################################################
Expand Down Expand Up @@ -91,6 +77,7 @@ if [ ! -f "$FAKE_EXE" ]; then
exit 1
fi


###########################################################################
# INSTALL DOCFX
###########################################################################
Expand Down Expand Up @@ -118,7 +105,6 @@ if [ ! -f "$SIGNTOOL_EXE" ]; then
fi
fi


###########################################################################
# WORKAROUND FOR MONO
###########################################################################
Expand Down
12 changes: 7 additions & 5 deletions src/Petabridge.Templates.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageType>Template</PackageType>
<PackageVersion>1.1.0</PackageVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageVersion>2.0.0</PackageVersion>
<PackageId>Petabridge.Templates</PackageId>
<Title>Petabridge.Templates</Title>
<Authors>Petabridge</Authors>
<Description>Professional .NET Core templates complete with CI, Docs, and more. Supports library, Akka.NET, and ASP.NET Core application types.</Description>
<PackageTags>dotnet-new;templates;petabridge;akka;</PackageTags>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageReleaseNotes>- Upgraded dependencies of all templates;
- Upgraded all templates to .NET Core 3.1;
- Added NBench 2.0 support to `pb-lib` template;
- Updated README documentation to accurately reflect latest content of all templates.</PackageReleaseNotes>
<PackageReleaseNotes>- Switched build automation system from FAKE to [NUKE](https://nuke.build/)
- Upgraded [pb-lib](https://github.com/petabridge/Petabridge.Library/), [`pb-akka-cluster`](https://github.com/petabridge/Petabridge.App) and [`pb-akka-web`](https://github.com/petabridge/Petabridge.App.Web) to all use .NET 6
- Replaced `common.props` with `Directory.Build.props`
- Git versioning with [GitVersion](https://gitversion.net/)</PackageReleaseNotes>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
</PropertyGroup>
<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
<Content Include="templates\**\*" Exclude="templates\**\bin\**;templates\**\obj\**" />
<Compile Remove="**\*" />
</ItemGroup>
Expand Down

0 comments on commit 35497e0

Please sign in to comment.