Skip to content

Commit e034d26

Browse files
committed
Deploy on windows runner
1 parent 15db997 commit e034d26

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/pack.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ name: pack
1919
on: [workflow_dispatch, pull_request]
2020

2121
jobs:
22-
ubuntu-latest:
23-
name: ubuntu-latest
24-
runs-on: ubuntu-latest
22+
windows-latest:
23+
name: windows-latest
24+
runs-on: windows-latest
2525
steps:
2626
- uses: actions/checkout@v6
2727
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
@@ -31,8 +31,8 @@ jobs:
3131
.nuke/temp
3232
~/.nuget/packages
3333
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
34-
- name: 'Run: Test, Pack'
35-
run: ./build.cmd Test Pack
34+
- name: 'Run: Pack'
35+
run: ./build.cmd Pack
3636
- name: 'Publish: packages'
3737
uses: actions/upload-artifact@v5
3838
with:

src/build/Build.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
[GitHubActions("pack", GitHubActionsImage.UbuntuLatest,
2-
InvokedTargets = [nameof(Test), nameof(Pack)],
1+
using Nuke.Common.Git;
2+
3+
[GitHubActions("pack", GitHubActionsImage.WindowsLatest,
4+
InvokedTargets = [nameof(Pack)],
35
AutoGenerate = true,
6+
PublishArtifacts = true,
47
On =
58
[
69
GitHubActionsTrigger.WorkflowDispatch,
710
GitHubActionsTrigger.PullRequest
811
])]
912
class Build : NukeBuild
1013
{
14+
[GitRepository]
15+
readonly GitRepository GitRepository;
16+
1117
[Solution(GenerateProjects = true)]
1218
readonly Solution Solution;
1319

1420
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
1521
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
1622

17-
public static int Main () => Execute<Build>(x => x.Test, x => x.Pack);
23+
public static int Main () => Execute<Build>(x => x.Pack);
1824

1925
Target Clean => _ => _
2026
.Executes(() =>
@@ -23,6 +29,7 @@ class Build : NukeBuild
2329
});
2430

2531
Target Pack => _ => _
32+
.DependsOn(Test)
2633
.Produces(PackagesDirectory / "*.nupkg")
2734
.Executes(() =>
2835
{
@@ -33,6 +40,7 @@ class Build : NukeBuild
3340
});
3441

3542
Target Test => _ => _
43+
.OnlyWhenStatic(()=> IsWin)
3644
.Executes(() =>
3745
{
3846
DotNetTasks.DotNetPublish(options => options

0 commit comments

Comments
 (0)