Skip to content

Commit

Permalink
Merge pull request #60 from Kiryuumaru/feat/updated-deps
Browse files Browse the repository at this point in the history
Updated deps
  • Loading branch information
Kiryuumaru committed Jun 4, 2024
2 parents c76e091 + 9a1ae17 commit d00d8d1
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 30 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/nuke-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre_setup:
name: Pre Setup
Expand Down Expand Up @@ -64,6 +67,15 @@ jobs:
steps:
- uses: actions/checkout@v4
if: ${{ matrix.id != 'skip' }}
- name: Cache Test
uses: actions/cache@v4
if: ${{ matrix.id != 'skip' }}
with:
path: ./.nuke/cache
key: test-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-${{ matrix.run_classification }}-${{ matrix.run_identifier }}"
restore-keys: |-
test-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-${{ matrix.run_classification }}-
test-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-main-
- name: Run Nuke PipelineTest
run: ${{ matrix.build_script }} PipelineTest --args "${{ matrix.ids_to_run }}"
if: ${{ matrix.id != 'skip' }}
Expand All @@ -81,13 +93,22 @@ jobs:
steps:
- uses: actions/checkout@v4
if: ${{ matrix.id != 'skip' }}
- name: Cache Build
uses: actions/cache@v4
if: ${{ matrix.id != 'skip' }}
with:
path: ./.nuke/cache
key: build-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-${{ matrix.run_classification }}-${{ matrix.run_identifier }}"
restore-keys: |-
build-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-${{ matrix.run_classification }}-
build-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-main-
- name: Run Nuke PipelineBuild
run: ${{ matrix.build_script }} PipelineBuild --args "${{ matrix.ids_to_run }}"
if: ${{ matrix.id != 'skip' }}
env:
NUKE_NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN }}
NUKE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: ${{ matrix.id != 'skip' }}
with:
Expand Down Expand Up @@ -117,6 +138,15 @@ jobs:
path: ./.nuke/output
pattern: ${{ matrix.id }}
merge-multiple: true
- name: Cache Publish
uses: actions/cache@v4
if: ${{ matrix.id != 'skip' }}
with:
path: ./.nuke/cache
key: publish-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-${{ matrix.run_classification }}-${{ matrix.run_identifier }}"
restore-keys: |-
publish-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-${{ matrix.run_classification }}-
publish-${{ matrix.runs_on }}-${{ matrix.id }}-${{ matrix.cache_invalidator }}-${{ matrix.environment }}-main-
- name: Run Nuke PipelinePublish
run: ${{ matrix.build_script }} PipelinePublish --args "${{ matrix.ids_to_run }}"
if: ${{ matrix.id != 'skip' }}
Expand All @@ -141,7 +171,7 @@ jobs:
name: Resolve NUKE_PUBLISH_SUCCESS
run: echo "NUKE_PUBLISH_SUCCESS=${NUKE_PUBLISH_SUCCESS_GITHUB/success/ok}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
- name: Download artifacts
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ./.nuke/output
Expand Down
4 changes: 0 additions & 4 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@
]
}
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
Expand Down
3 changes: 0 additions & 3 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ public class Build : BaseNukeBuildHelpers
{
public static int Main () => Execute<Build>(x => x.Version);

[Solution(GenerateProjects = true)]
internal readonly Solution Solution;

public override string[] EnvironmentBranches { get; } = ["prerelease", "master"];

public override string MainEnvironmentBranch => "master";
Expand Down
39 changes: 23 additions & 16 deletions build/TransactionHelpersEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class TransactionHelpersEntry : AppEntry<Build>

public override RunsOnType PublishRunsOn => RunsOnType.Ubuntu2204;

public override RunType RunBuildOn => RunType.All;

[SecretVariable("NUGET_AUTH_TOKEN")]
readonly string NuGetAuthToken;

Expand All @@ -29,25 +31,30 @@ public class TransactionHelpersEntry : AppEntry<Build>

public override void Build(AppRunContext appRunContext)
{
var projPath = RootDirectory / "TransactionHelpers" / "TransactionHelpers.csproj";
var version = "0.0.0";
var releaseNotes = "";
if (appRunContext is AppBumpRunContext appBumpRunContext)
{
OutputDirectory.DeleteDirectory();
DotNetTasks.DotNetClean(_ => _
.SetProject(NukeBuild.Solution.TransactionHelpers));
DotNetTasks.DotNetBuild(_ => _
.SetProjectFile(NukeBuild.Solution.TransactionHelpers)
.SetConfiguration("Release"));
DotNetTasks.DotNetPack(_ => _
.SetProject(NukeBuild.Solution.TransactionHelpers)
.SetConfiguration("Release")
.SetNoRestore(true)
.SetNoBuild(true)
.SetIncludeSymbols(true)
.SetSymbolPackageFormat("snupkg")
.SetVersion(appBumpRunContext.AppVersion.Version?.ToString() ?? "0.0.0")
.SetPackageReleaseNotes(appBumpRunContext.AppVersion.ReleaseNotes)
.SetOutputDirectory(OutputDirectory));
version = appBumpRunContext.AppVersion.Version.ToString();
releaseNotes = appBumpRunContext.AppVersion.ReleaseNotes;
}

DotNetTasks.DotNetClean(_ => _
.SetProject(projPath));
DotNetTasks.DotNetBuild(_ => _
.SetProjectFile(projPath)
.SetConfiguration("Release"));
DotNetTasks.DotNetPack(_ => _
.SetProject(projPath)
.SetConfiguration("Release")
.SetNoRestore(true)
.SetNoBuild(true)
.SetIncludeSymbols(true)
.SetSymbolPackageFormat("snupkg")
.SetVersion(version)
.SetPackageReleaseNotes(releaseNotes)
.SetOutputDirectory(OutputDirectory));
}

public override void Publish(AppRunContext appRunContext)
Expand Down
8 changes: 4 additions & 4 deletions build/TransactionHelpersTestEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ public class TransactionHelpersTestEntry : AppTestEntry<Build>
{
public override RunsOnType RunsOn => RunsOnType.Ubuntu2204;

public override RunTestType RunTestOn => RunTestType.All;

public override Type[] AppEntryTargets => [typeof(TransactionHelpersEntry)];

public override void Run(AppTestRunContext appTestContext)
{
var projPath = RootDirectory / "TransactionHelpers.UnitTest" / "TransactionHelpers.UnitTest.csproj";

DotNetTasks.DotNetClean(_ => _
.SetProject(NukeBuild.Solution.TransactionHelpers_UnitTest));
.SetProject(projPath));
DotNetTasks.DotNetTest(_ => _
.SetProjectFile(NukeBuild.Solution.TransactionHelpers_UnitTest));
.SetProjectFile(projPath));
}
}
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="8.0.0" />
<PackageReference Include="NukeBuildHelpers" Version="2.4.0" />
<PackageReference Include="NukeBuildHelpers" Version="2.5.0" />
</ItemGroup>

</Project>

0 comments on commit d00d8d1

Please sign in to comment.