-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
beb0381
commit 4b038b9
Showing
10 changed files
with
185 additions
and
2 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,13 @@ | ||
on: | ||
schedule: | ||
# every Sunday at 6am | ||
- cron: '0 6 * * SUN' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
dependabot-cake: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: check/update cake dependencies | ||
uses: augustoproiete-actions/nils-org--dependabot-cake-action@v1 |
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 |
---|---|---|
|
@@ -24,5 +24,6 @@ Thumbs.db | |
*.nupkg | ||
**/packages/* | ||
|
||
#Ignore files created by ReSharper | ||
_ReSharper*/ | ||
#cake | ||
.cake/ | ||
/artifacts/* |
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,109 @@ | ||
#tool "nuget:?package=NuGet.CommandLine&version=5.8.1" | ||
|
||
#addin "nuget:?package=Cake.MinVer&version=1.0.0" | ||
#addin "nuget:?package=Cake.Args&version=1.0.0" | ||
|
||
var target = ArgumentOrDefault<string>("target") ?? "pack"; | ||
var buildVersion = MinVer(s => s.WithTagPrefix("v").WithDefaultPreReleasePhase("preview")); | ||
|
||
Task("clean") | ||
.Does(() => | ||
{ | ||
CleanDirectories("./artifacts/**"); | ||
CleanDirectories("./packages/**"); | ||
CleanDirectories("./**/^{bin,obj}"); | ||
}); | ||
|
||
Task("restore") | ||
.IsDependentOn("clean") | ||
.Does(() => | ||
{ | ||
NuGetRestore("./exceldna-diagnostics-serilog.sln", new NuGetRestoreSettings | ||
{ | ||
NoCache = true, | ||
}); | ||
}); | ||
|
||
Task("build") | ||
.IsDependentOn("restore") | ||
.DoesForEach(new[] { "Debug", "Release" }, (configuration) => | ||
{ | ||
MSBuild("./exceldna-diagnostics-serilog.sln", settings => settings | ||
.SetConfiguration(configuration) | ||
.UseToolVersion(MSBuildToolVersion.VS2019) | ||
.WithTarget("Rebuild") | ||
.WithProperty("Version", buildVersion.Version) | ||
.WithProperty("FileVersion", buildVersion.FileVersion) | ||
.WithProperty("ContinuousIntegrationBuild", "true") | ||
); | ||
}); | ||
|
||
Task("test") | ||
.IsDependentOn("build") | ||
.Does(() => | ||
{ | ||
var settings = new DotNetCoreTestSettings | ||
{ | ||
Configuration = "Release", | ||
NoRestore = true, | ||
NoBuild = true, | ||
}; | ||
|
||
var projectFiles = GetFiles("./test/**/*.csproj"); | ||
foreach (var file in projectFiles) | ||
{ | ||
DotNetCoreTest(file.FullPath, settings); | ||
} | ||
}); | ||
|
||
Task("pack") | ||
.IsDependentOn("test") | ||
.Does(() => | ||
{ | ||
var releaseNotes = $"https://github.com/augustoproiete/exceldna-diagnostics-serilog/releases/tag/v{buildVersion.Version}"; | ||
|
||
DotNetCorePack("./src/ExcelDna.Diagnostics.Serilog/ExcelDna.Diagnostics.Serilog.csproj", new DotNetCorePackSettings | ||
{ | ||
Configuration = "Release", | ||
NoRestore = true, | ||
NoBuild = true, | ||
IncludeSymbols = true, | ||
IncludeSource = true, | ||
OutputDirectory = "./artifacts/nuget", | ||
ArgumentCustomization = args => | ||
args.AppendQuoted($"-p:Version={buildVersion.Version}") | ||
.AppendQuoted($"-p:PackageReleaseNotes={releaseNotes}") | ||
}); | ||
}); | ||
|
||
Task("push") | ||
.IsDependentOn("pack") | ||
.Does(() => | ||
{ | ||
var url = EnvironmentVariable("NUGET_URL"); | ||
if (string.IsNullOrWhiteSpace(url)) | ||
{ | ||
Information("No NuGet URL specified. Skipping publishing of NuGet packages"); | ||
return; | ||
} | ||
|
||
var apiKey = EnvironmentVariable("NUGET_API_KEY"); | ||
if (string.IsNullOrWhiteSpace(apiKey)) | ||
{ | ||
Information("No NuGet API key specified. Skipping publishing of NuGet packages"); | ||
return; | ||
} | ||
|
||
var nugetPushSettings = new DotNetCoreNuGetPushSettings | ||
{ | ||
Source = url, | ||
ApiKey = apiKey, | ||
}; | ||
|
||
foreach (var nugetPackageFile in GetFiles("./artifacts/nuget/*.nupkg")) | ||
{ | ||
DotNetCoreNuGetPush(nugetPackageFile.FullPath, nugetPushSettings); | ||
} | ||
}); | ||
|
||
RunTarget(target); |
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,11 @@ | ||
@echo on | ||
@cd %~dp0 | ||
|
||
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
set DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
set DOTNET_NOLOGO=1 | ||
|
||
dotnet tool restore | ||
@if %ERRORLEVEL% neq 0 goto :eof | ||
|
||
dotnet cake %* |
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,13 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
Set-Location -LiteralPath $PSScriptRoot | ||
|
||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1' | ||
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1' | ||
$env:DOTNET_NOLOGO = '1' | ||
|
||
dotnet tool restore | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | ||
|
||
dotnet cake @args | ||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } |
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,12 @@ | ||
#!/usr/bin/env bash | ||
set -euox pipefail | ||
|
||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
|
||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 | ||
export DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||
export DOTNET_NOLOGO=1 | ||
|
||
dotnet tool restore | ||
|
||
dotnet cake "$@" |
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,12 @@ | ||
[Nuget] | ||
Source=https://api.nuget.org/v3/index.json | ||
UseInProcessClient=true | ||
LoadDependencies=false | ||
|
||
[Paths] | ||
Tools=./.cake | ||
Addins=./.cake/addins | ||
Modules=./.cake/modules | ||
|
||
[Settings] | ||
SkipVerification=false |
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,7 @@ | ||
{ | ||
"sdk": { | ||
"allowPrerelease": false, | ||
"version": "5.0.100", | ||
"rollForward": "latestFeature" | ||
} | ||
} |