Skip to content

Commit

Permalink
Merge branch 'prerelease'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiryuumaru committed May 23, 2024
2 parents 129b786 + a10d028 commit 1316f08
Show file tree
Hide file tree
Showing 37 changed files with 901 additions and 345 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/nuke-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- id: NUKE_PRE_SETUP_HAS_RELEASE
name: Output NUKE_PRE_SETUP_HAS_RELEASE
run: echo "NUKE_PRE_SETUP_HAS_RELEASE=$(cat ./.nuke/temp/pre_setup_has_release.txt)" >> $GITHUB_OUTPUT
- id: NUKE_PRE_SETUP_HAS_ENTRIES
name: Output NUKE_PRE_SETUP_HAS_ENTRIES
run: echo "NUKE_PRE_SETUP_HAS_ENTRIES=$(cat ./.nuke/temp/pre_setup_has_entries.txt)" >> $GITHUB_OUTPUT
- id: NUKE_PRE_SETUP_OUTPUT
name: Output NUKE_PRE_SETUP_OUTPUT
run: echo "NUKE_PRE_SETUP_OUTPUT=$(cat ./.nuke/temp/pre_setup_output.json)" >> $GITHUB_OUTPUT
Expand All @@ -38,6 +41,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
NUKE_PRE_SETUP_HAS_RELEASE: ${{ steps.NUKE_PRE_SETUP_HAS_RELEASE.outputs.NUKE_PRE_SETUP_HAS_RELEASE }}
NUKE_PRE_SETUP_HAS_ENTRIES: ${{ steps.NUKE_PRE_SETUP_HAS_ENTRIES.outputs.NUKE_PRE_SETUP_HAS_ENTRIES }}
NUKE_PRE_SETUP_OUTPUT: ${{ steps.NUKE_PRE_SETUP_OUTPUT.outputs.NUKE_PRE_SETUP_OUTPUT }}
NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX: ${{ steps.NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX.outputs.NUKE_PRE_SETUP_OUTPUT_TEST_MATRIX }}
NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX: ${{ steps.NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX.outputs.NUKE_PRE_SETUP_OUTPUT_BUILD_MATRIX }}
Expand All @@ -63,13 +67,16 @@ jobs:
runs-on: ${{ matrix.runs_on }}
steps:
- uses: actions/checkout@v4
if: ${{ matrix.id != 'skip' }}
- 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
uses: actions/upload-artifact@v4
if: ${{ matrix.id != 'skip' }}
with:
name: ${{ matrix.id }}
path: ./.nuke/output/*
Expand All @@ -78,7 +85,7 @@ jobs:
needs:
- pre_setup
- test
if: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_HAS_RELEASE == 'true' }}
if: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_HAS_ENTRIES == 'true' }}
env:
NUKE_PRE_SETUP_OUTPUT: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT }}
strategy:
Expand All @@ -89,22 +96,25 @@ jobs:
runs-on: ${{ matrix.runs_on }}
steps:
- uses: actions/checkout@v4
if: ${{ matrix.id != 'skip' }}
- name: Download artifacts
uses: actions/download-artifact@v4
if: ${{ matrix.id != 'skip' }}
with:
path: ./.nuke/output
pattern: ${{ matrix.id }}
merge-multiple: true
- name: Run Nuke PipelinePublish
run: ${{ matrix.build_script }} PipelinePublish --args "${{ matrix.ids_to_run }}"
if: ${{ matrix.id != 'skip' }}
env:
NUKE_NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN }}
NUKE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
needs:
- pre_setup
- test
- build
if: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_HAS_RELEASE == 'true' }}
if: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_HAS_ENTRIES == 'true' }}
env:
NUKE_PRE_SETUP_OUTPUT: ${{ needs.pre_setup.outputs.NUKE_PRE_SETUP_OUTPUT }}
strategy:
Expand Down
11 changes: 8 additions & 3 deletions NukeBuildHelpers/AppEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Nuke.Common.IO;
using NukeBuildHelpers.Common;
using NukeBuildHelpers.Enums;
using NukeBuildHelpers.Models.RunContext;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -19,13 +20,17 @@ public abstract class AppEntry : Entry

public abstract RunsOnType PublishRunsOn { get; }

public virtual RunType RunBuildOn { get; } = RunType.Bump;

public virtual RunType RunPublishOn { get; } = RunType.Bump;

public virtual bool MainRelease { get; } = true;

public NewVersion? NewVersion { get; internal set; }
public virtual void Build(AppRunContext appRunContext) { }

public virtual void Build() { }
public virtual void Publish(AppRunContext appRunContext) { }

public virtual void Publish() { }
internal AppRunContext? AppRunContext { get; set; }
}

public abstract class AppEntry<TBuild> : AppEntry
Expand Down
9 changes: 6 additions & 3 deletions NukeBuildHelpers/AppTestEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@
using Nuke.Common.IO;
using NukeBuildHelpers.Common;
using NukeBuildHelpers.Enums;
using NukeBuildHelpers.Models.RunContext;

namespace NukeBuildHelpers;

public abstract class AppTestEntry : Entry
{
public abstract RunsOnType RunsOn { get; }

public virtual TestRunType RunType { get; } = TestRunType.Always;
public virtual RunTestType RunTestOn { get; } = RunTestType.All;

public abstract Type[] AppEntryTargets { get; }
public virtual Type[] AppEntryTargets { get; } = [];

public virtual void Run() { }
public virtual void Run(AppTestRunContext appTestContext) { }

internal AppTestRunContext? AppTestContext { get; set; }
}

public abstract class AppTestEntry<TBuild> : AppTestEntry
Expand Down

0 comments on commit 1316f08

Please sign in to comment.