Skip to content

Commit 6771dfc

Browse files
committed
Changed target to build and test
1 parent edd8d8b commit 6771dfc

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Diff for: .github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
- name: Run Script
1919
shell: pwsh
2020
run: |
21-
.\build.ps1
21+
.\build.ps1 --target=BuildAndTest

Diff for: build/Build/Context.cs

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public class App
4646
{
4747
public const string PROJECT_NAME = "Commons.Builders.Model";
4848
public string BuildConfig { get; } = "Release";
49+
public string Framework { get; } = "netstandard2.0";
50+
public string Runtime { get; } = "win-x64";
4951

5052
public string MainProject { get; } = @$"src\{PROJECT_NAME}\{PROJECT_NAME}.csproj";
5153
}

Diff for: build/Build/Lifetime.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public override void Setup(Context context, ISetupContext info)
2828
catch (Exception ex)
2929
{
3030
context.Error(ex);
31+
// running dev pipeline by default if we can't determine otherwise
32+
context.General.CurrentBranch = new BranchService().GetBranch("develop");
3133
}
3234

3335
context.Information(string.Join(Environment.NewLine, context.Environment.GetEnvironmentVariables()));
@@ -38,8 +40,8 @@ public override void Teardown(Context context, ITeardownContext info) =>
3840

3941
private void SetBranchInContext(Context context)
4042
{
43+
//FIXME: git tool is not working on github actions pipeline
4144
GitVersion gitVersion = context.GitVersion(new GitVersionSettings { NoFetch = true });
42-
context.Information($"Branch name raw: {gitVersion.BranchName} - Commit date {gitVersion.CommitDate}");
4345
string branchName = gitVersion.BranchName.ToLower();
4446
context.General.CurrentBranchName = branchName;
4547
context.General.CurrentBranch = new BranchService().GetBranch(branchName);

Diff for: build/Build/Tasks/PublishApp.cs

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44

55
using Cake.Common.Tools.DotNet;
66
using Cake.Common.Tools.DotNet.Publish;
7-
// using Cake.Common.Tools.DotNetCore.Publish;
87
using Cake.Frosting;
98

109
namespace Build
1110
{
1211
public class PublishApp : FrostingTask<Context>
1312
{
14-
/// <summary>Runs the task using the specified context.</summary>
15-
/// <param name="context">The context.</param>
1613
public override void Run(Context context)
1714
{
1815
string versionSuffix;
@@ -28,15 +25,14 @@ public override void Run(Context context)
2825

2926
DotNetPublishSettings dotNetCorePublishSettings = new()
3027
{
31-
Configuration = "release",
28+
Configuration = context.App.BuildConfig,
3229
PublishSingleFile = false,
3330
SelfContained = false,
34-
//PublishTrimmed = true,
3531
PublishReadyToRun = false,
36-
Runtime = "win-x64",
32+
Runtime = context.App.Runtime,
3733
OutputDirectory = context.General.ArtifactsDir,
3834
VersionSuffix = versionSuffix,
39-
Framework = "netstandard2.0"
35+
Framework = context.App.Framework
4036
};
4137

4238
context.DotNetPublish(context.App.MainProject, dotNetCorePublishSettings);

0 commit comments

Comments
 (0)