Skip to content

Commit

Permalink
Merge pull request #30 from bt-skyrise/release/0.2.0-publish-nuget-pa…
Browse files Browse the repository at this point in the history
…ckage

Merge release/0.2.0-publish-nuget-package

* #15 use options object in PostgresRunner API
* #5 Added Cake build script (#23)
* #7 Added Appveyor CI configuration (#24)
* #10 Fix broken linux pg distribution (#28)
* Added release,hotfix branches to CI build
* Appveyor - verbose logging of gitversion
  • Loading branch information
zabrowarnyrafal committed Feb 14, 2018
2 parents b313eee + 1784470 commit 8ab35e7
Show file tree
Hide file tree
Showing 2,692 changed files with 138,053 additions and 11 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ src/[Bb]in/
*.VisualState.xml
TestResult.xml

# XUNIT
test-results/**

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
Expand Down Expand Up @@ -169,6 +172,7 @@ PublishScripts/
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
artifacts/

# Microsoft Azure Build Output
csx/
Expand Down Expand Up @@ -274,9 +278,9 @@ paket-files/
__pycache__/
*.pyc

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Cake
tools/**
!tools/packages.config

# Telerik's JustMock configuration file
*.jmconfig
Expand Down
10 changes: 10 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
assembly-versioning-scheme: MajorMinor
mode: ContinuousDelivery
branches:
dev(elop)?(ment)?$:
mode: ContinuousDeployment
master:
mode: ContinuousDelivery
(pull|pull\-requests|pr)[/-]: {}
ignore:
sha: []
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ SOFTWARE.

====

All files located in the tools folder are externally maintained libraries used by this software which have their own licenses; we recommend you read them, as their terms may differ from the terms above.
All files located in the pg-dist folder are externally maintained libraries used by this software which have their own licenses; we recommend you read them, as their terms may differ from the terms above.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ Special thanks to all [Contributors](CREDITS.md)
# License

This software is distributed under [MIT License](LICENSE.md).

It contains third-party files located in the tools folder that are distributed under [PostgreSQL License](tools/LICENSE.md)
It contains third-party files located in the pg-dist folder that are distributed under [PostgreSQL License](tools/LICENSE.md)
63 changes: 63 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
version: '{build}'
pull_requests:
do_not_increment_build_number: true
branches:
only:
- master
- develop
- /release\/*/
- /hotfix\/*/
skip_tags: true
shallow_clone: false
environment:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
VERSION_INFO_SEMVER: null
VERSION_INFO: null
nuget:
project_feed: true
disable_publish_on_pr: true
init:
before_build:
- ps: >-
$version_info_json = (gitversion /l console /output json);
$version_info = (gitversion /output json | ConvertFrom-Json);
$env:VERSION_INFO = $version_info;
$env:VERSION_INFO_SEMVER = $version_info.SemVer;
Update-AppveyorBuild -Version "$env:VERSION_INFO_SEMVER-$env:APPVEYOR_BUILD_NUMBER";
Write-Host "Get GitVersion output = " $version_info_json;
Write-Host "Set VERSION_INFO_SEMVER = " $env:VERSION_INFO_SEMVER;
Write-Host "Set APPVEYOR_BUILD_VERSION = " $env:APPVEYOR_BUILD_VERSION;
build_script:
- ps: .\build.ps1
test: off
artifacts:
- path: .\artifacts\*.nupkg
name: NuGet
- path: .\test-results\*.xml
name: Xunit
deploy:
- provider: GitHub
tag: ${VERSION_INFO_SEMVER}
release: v${VERSION_INFO_SEMVER}
auth_token:
secure: JGXCP5ogwbyjc0iZqs8i6O/Znx87GbpVFF/Om9OAW9/6fNpygIspgaUDtnAWx1jD
artifact: nothing
draft: true
on:
branch: master
- provider: NuGet
api_key:
secure: p3Sk0hJZF4uia94ka0L+0VY4VXB2CP188Rq0kky1/ZHvaHacb4LaXxEG7crELBxe
skip_symbols: true
artifact: NuGet
on:
branch: master
134 changes: 134 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
// Addins
#addin "nuget:?package=Cake.Incubator"

// Tools
#tool "xunit.runner.console"
#tool "nuget:?package=GitVersion.CommandLine"

// Parameters
var configuration = Argument("Configuration", "Release");
var target = Argument("Target", "Default");

// Variables
var outputDir = Directory("./artifacts");
var projectDir = GetFiles("./src/Postgres2Go/*.csproj").FirstOrDefault();
var solution = GetFiles("./src/*.sln").FirstOrDefault();
var tests = GetFiles("./src/Postgres2Go.Tests/*.csproj").FirstOrDefault();
var testResultsDir = Directory("./test-results/");
GitVersion versionInfo = null;


// Tasks
Task("Clean")
.Does(() => {
Information("Removing previous build artifacts");
if(DirectoryExists(testResultsDir.Path))
DeleteDirectory(testResultsDir.Path,
new DeleteDirectorySettings()
{
Recursive = true
});
if(DirectoryExists(outputDir.Path))
DeleteDirectory(outputDir.Path,
new DeleteDirectorySettings()
{
Recursive = true
});
});

Task("Prepare-Directories")
.IsDependentOn("Clean")
.Does(() =>
{
Information("Prepare directory for tests output");
EnsureDirectoryExists(testResultsDir.Path);
Information("Prepare directory for lib output");
EnsureDirectoryExists(outputDir.Path);
});

Task("Restore-NuGet-Packages")
.IsDependentOn("Prepare-Directories")
.Does(() => {
Information("Restoring nuget packages for solution");
DotNetCoreRestore(solution.FullPath);
});

Task("Get-Version-Info")
.Does(() => {
Information("Set artifacts version");
versionInfo = GitVersion(
new GitVersionSettings {
UpdateAssemblyInfo = true,
OutputType = GitVersionOutput.Json
});
Information("Version is: {0}", versionInfo.Dump());
});

Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.IsDependentOn("Get-Version-Info")
.Does(() => {
Information("Build solution");
DotNetCoreBuild(solution.FullPath,
new DotNetCoreBuildSettings()
{
Configuration = configuration,
ArgumentCustomization = args => args
.Append("--no-restore")
.Append("/p:SemVer=" + versionInfo.NuGetVersion) ,
});
});

Task("Test")
.IsDependentOn("Build")
.Does(() => {
var resultsFile = $"..\\..\\..\\test-results\\{tests.GetFilenameWithoutExtension()}.xml";
var testProject = tests.FullPath;
Information($"Run tests of {tests.GetFilenameWithoutExtension()}");
DotNetCoreTest(testProject,
new DotNetCoreTestSettings()
{
Configuration = configuration,
NoBuild = true,
ArgumentCustomization = args => args
.Append($"-r {testResultsDir.Path.FullPath}")
.Append($"-l trx;logfilename={resultsFile}")
});
});

Task("Pack")
.IsDependentOn("Test")
.Does(() => {
Information("Creating nuget package");
DotNetCorePack(
projectDir.GetDirectory().FullPath,
new DotNetCorePackSettings()
{
Configuration = configuration,
IncludeSymbols = false,
IncludeSource = false,
NoBuild = true,
NoRestore = true,
OutputDirectory = outputDir.Path,
Verbosity = DotNetCoreVerbosity.Minimal,
ArgumentCustomization = args=> args
.Append("/p:PackageVersion=" + versionInfo.NuGetVersion)
});
});

Task("Default")
.IsDependentOn("Pack");

// Run
RunTarget(target);
Loading

0 comments on commit 8ab35e7

Please sign in to comment.