Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b946d8d
add possibility publish nuget using circleci if tag is define
fle-bach Feb 26, 2019
c96cca1
repair formattedNugetVersion to version
fle-bach Feb 26, 2019
2a81f41
repair build.cake
fle-bach Feb 26, 2019
8520be8
add condition for push package && add =
fle-bach Feb 26, 2019
fbe8d29
test tags only version 0-9.0-9.0-9
fle-bach Feb 26, 2019
59818b3
test tags only version 6-9.0-9.0-9
fle-bach Feb 26, 2019
2e0642d
all jobs with filters
fle-bach Feb 26, 2019
6ce0863
test tags version
fle-bach Feb 26, 2019
0f5b682
add jobs who do just release
fle-bach Feb 26, 2019
161a4d1
do release in other workflow
fle-bach Feb 26, 2019
a4562e4
* to +
fle-bach Feb 26, 2019
1fc21b2
add ignore branches
fle-bach Feb 26, 2019
aa7640f
test surcharge project username
fle-bach Feb 26, 2019
4c8d4b7
test write tag
fle-bach Feb 26, 2019
7b4b310
return with filter *
fle-bach Feb 26, 2019
2403587
test tag
fle-bach Feb 26, 2019
9405f97
test tag
fle-bach Feb 26, 2019
d40075d
test on one job
fle-bach Feb 26, 2019
851766c
test on one job
fle-bach Feb 26, 2019
7e87f55
test with tag
fle-bach Feb 26, 2019
e3dae58
test with tag and img dotnet with this path
fle-bach Feb 26, 2019
f6509d3
push version normaly can push nuget if tag is precise (but failed if …
fle-bach Feb 26, 2019
441ef35
launch circleci test
fle-bach Feb 26, 2019
d49dff4
add check tag with good format
fle-bach Feb 27, 2019
8afcc50
fix ./ for path
fle-bach Feb 27, 2019
fd728ee
build release using one workflows
fle-bach Feb 27, 2019
1891c53
change method for get directory by cake.xcomponent
fle-bach Feb 27, 2019
edf4734
delete nuget MSTest unused
fle-bach Feb 27, 2019
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
55 changes: 51 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ references:
key: v2-nuget-{{ .Branch }}-{{ checksum "shasum.tmp" }}
paths:
- /home/circleci/.nuget

jobs:
checkout_code:
docker:
Expand All @@ -49,12 +49,18 @@ jobs:
- *restore_nuget
- run:
name: ReactiveApi - Build All
command: cd /home/circleci/project/ && ./build.sh -t All
command: |
if [ "${CIRCLE_TAG}" == "" ]; then
cd /home/circleci/project/ && ./build.sh -t All
else
cd /home/circleci/project/ && ./build.sh -t All -buildConfiguration=Release -buildVersion=$CIRCLE_TAG
fi
- *save_nuget
- persist_to_workspace:
root: /home/circleci/project
paths:
- packaging
- nuget

build_sh_intergration_test_reactiveapi:
docker:
Expand Down Expand Up @@ -97,17 +103,58 @@ jobs:
cd ./docker/integration_tests/dockerScripts
docker-compose -f ./docker-compose-reactiveapi.yml up --exit-code-from clientapp

deploy_nuget:
docker:
- image: microsoft/dotnet:2.1-sdk
steps:
- *restore_repo
- *generate_nuget_shasum
- *restore_nuget
- attach_workspace:
at: /home/circleci/project
- run:
name: Deploy nuget package
command: cd /home/circleci/project/ && ./build.sh -t PushPackage -buildConfiguration=Release -buildVersion=$CIRCLE_TAG -nugetkey=$NUGET_API_KEY

workflows:
version: 2
xcomponent_reactive_api:
jobs:
- checkout_code
- checkout_code:
filters:
tags:
only: /^[0-9]++\.[0-9]++\.[0-9]++/
branches:
only: /.*/
- build_sh_reactiveapi:
requires:
- checkout_code
filters:
tags:
only: /^[0-9]++\.[0-9]++\.[0-9]++/
branches:
only: /.*/
- build_sh_intergration_test_reactiveapi:
requires:
- build_sh_reactiveapi
filters:
tags:
only: /^[0-9]++\.[0-9]++\.[0-9]++/
branches:
only: /.*/
- reactiveapi_integrationtests:
requires:
- build_sh_intergration_test_reactiveapi
- build_sh_intergration_test_reactiveapi
filters:
tags:
only: /^[0-9]++\.[0-9]++\.[0-9]++/
branches:
only: /.*/
- deploy_nuget:
requires:
- reactiveapi_integrationtests
filters:
tags:
only: /^[0-9]++\.[0-9]++\.[0-9]++/
branches:
ignore: /.*/
2 changes: 0 additions & 2 deletions ReactiveXComponentTest/ReactiveXComponentTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<ItemGroup>
<PackageReference Include="Castle.Core" Version="4.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="NFluent" Version="2.4.0" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
Expand Down
15 changes: 6 additions & 9 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.9.0"
#addin "Cake.FileHelpers&version=3.1.0"
#addin "Cake.XComponent&version=6.0.0"
#addin "Cake.XComponent&version=6.0.1"
#addin "Cake.Incubator&version=3.0.0"
#load "cake.scripts/utilities.cake"

var target = Argument("target", "Build");
var buildConfiguration = Argument("buildConfiguration", "Debug");
var version = Argument("buildVersion", "1.0.0-build1");
var version = Argument("buildVersion", "1.0.0");
var vsVersion = Argument("vsVersion", "VS2017");
var apiKey = Argument("nugetKey", "");
var setAssemblyVersion = Argument<bool>("setAssemblyVersion", false);
Expand Down Expand Up @@ -60,26 +60,23 @@ Task("Test")
Task("CreatePackage")
.Does(() =>
{
var formattedNugetVersion = FormatNugetVersion(version);
DotNetCorePack(
"ReactiveXComponent/ReactiveXComponent.csproj",
new DotNetCorePackSettings {
Configuration = buildConfiguration,
OutputDirectory = @"nuget",
VersionSuffix = formattedNugetVersion,
MSBuildSettings = new DotNetCoreMSBuildSettings{}.SetVersion(formattedNugetVersion),
VersionSuffix = version,
MSBuildSettings = new DotNetCoreMSBuildSettings{}.SetVersion(version),
}
);
});

Task("PushPackage")
.IsDependentOn("All")
.Does(() =>
{
var formattedNugetVersion = FormatNugetVersion(version);
if (!string.IsNullOrEmpty(apiKey))
{
var package = "./nuget/ReactiveXComponent.Net." + formattedNugetVersion + ".nupkg";
var package = "./nuget/ReactiveXComponent.Net." + version + ".nupkg";
DotNetCoreNuGetPush(package, new DotNetCoreNuGetPushSettings
{
Source = "https://www.nuget.org/api/v2/package",
Expand Down Expand Up @@ -151,7 +148,7 @@ Task("BuildIntegrationTests")
Task("PackageDockerIntegrationTests")
.Does(() =>
{
Zip( GetXcRuntimePath().Replace("xcruntime.exe", ""), "./docker/integration_tests/dockerScripts/XCContainer/XCRuntime.zip");
Zip( GetXcRuntimeDirectory(), "./docker/integration_tests/dockerScripts/XCContainer/XCRuntime.zip");
Zip("./docker/integration_tests/XCProjects/HelloWorldV5/xcr/xcassemblies", "./docker/integration_tests/dockerScripts/XCContainer/HelloWorldV5XCassemblies.zip");
Zip("./docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances/bin/" + buildConfiguration + "/netcoreapp2.1", "./docker/integration_tests/dockerScripts/AppsContainer/CreateInstanceReactiveApi.zip");
});
Expand Down
129 changes: 0 additions & 129 deletions cake.scripts/utilities.cake
Original file line number Diff line number Diff line change
@@ -1,134 +1,5 @@
#addin "Cake.Incubator&version=3.0.0"

var FormatAssemblyVersion = new Func<string, string>(currentVersion =>
{
var result = string.Empty;
var versionType = string.Empty;

if (currentVersion.Contains("build"))
{
versionType = "build";
}
else if (currentVersion.Contains("rc"))
{
versionType = "rc";
}
else if (currentVersion.Contains("release"))
{
versionType = "release";
}

if (!string.IsNullOrEmpty(versionType))
{
var versionComponents = currentVersion.Split('-');
var majorVersion = versionComponents[0];
var buildVersion = versionComponents[1];
var buildNumberStr = buildVersion.Substring(
versionType.Length,
buildVersion.Length - versionType.Length);

var buildNumber = int.Parse(buildNumberStr);
var buildNumberPrefix = string.Empty;
if (buildNumber < 10)
{
buildNumberPrefix = "000";
}
else if (buildNumber < 100)
{
buildNumberPrefix = "00";
}
else if (buildNumber < 1000)
{
buildNumberPrefix = "0";
}
else if (buildNumber > 60000)
{
buildNumberPrefix = "9";
}

var versionTypeNumber = string.Empty;

switch (versionType)
{
case "build":
versionTypeNumber = "1";
break;
case "rc":
versionTypeNumber = "2";
break;
case "release":
versionTypeNumber = "3";
break;
default:
versionTypeNumber = "0";
break;
}

result = majorVersion + "." + versionTypeNumber + buildNumberPrefix + buildNumberStr;
}
else
{
result = currentVersion + ".4";
}

return result;
});

var FormatNugetVersion = new Func<string, string>(currentVersion =>
{
var result = currentVersion;
var versionType = string.Empty;

if (currentVersion.Contains("build"))
{
versionType = "build";
}
else if (currentVersion.Contains("rc"))
{
versionType = "rc";
}
else if (currentVersion.Contains("release"))
{
versionType = "release";
}

if (!string.IsNullOrEmpty(versionType))
{
var versionComponents = currentVersion.Split('-');
var majorVersion = versionComponents[0];

if (versionType == "release")
{
result = majorVersion;
}
else
{
var buildVersion = versionComponents[1];
var buildNumberStr = buildVersion.Substring(
versionType.Length,
buildVersion.Length - versionType.Length);

var buildNumber = int.Parse(buildNumberStr);
var buildNumberPrefix = string.Empty;
if (buildNumber < 10)
{
buildNumberPrefix = "00";
}
else if (buildNumber < 100)
{
buildNumberPrefix = "0";
}
else if (buildNumber > 1000)
{
buildNumberPrefix = string.Empty;
}
result = majorVersion + "-" + versionType + "v" + buildNumberPrefix + buildNumberStr;
}
}

return result;
});

Func<bool> IsRunningOnOsx = () =>
{
return DirectoryExists("/Applications");
Expand Down