Skip to content

Commit d219299

Browse files
Update GHA CI workflow to publish build artifacts
1 parent 911fa7f commit d219299

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
job:
2929
- os: windows-2019
3030
build: ./build.cmd
31+
push: true
3132
name: ${{ matrix.job.os }}
3233
runs-on: ${{ matrix.job.os }}
3334
steps:
@@ -42,3 +43,10 @@ jobs:
4243
fetch-depth: 0
4344
- name: Build
4445
run: ${{ matrix.job.build }} --verbosity=diagnostic --target=pack
46+
- name: Publish artifacts
47+
if: matrix.job.push && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
48+
uses: actions/upload-artifact@v2.2.4
49+
with:
50+
if-no-files-found: warn
51+
name: package
52+
path: artifact/nuget/**/*

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ Thumbs.db
3030

3131
#cake
3232
.cake/
33-
/artifacts/*
33+
/artifact/*

build.cake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var buildVersion = MinVer(s => s.WithTagPrefix("v").WithDefaultPreReleasePhase("
99
Task("clean")
1010
.Does(() =>
1111
{
12-
CleanDirectories("./artifacts/**");
12+
CleanDirectories("./artifact/**");
1313
CleanDirectories("./packages/**");
1414
CleanDirectories("./**/^{bin,obj}");
1515
});
@@ -69,10 +69,10 @@ Task("pack")
6969
NoBuild = true,
7070
IncludeSymbols = true,
7171
IncludeSource = true,
72-
OutputDirectory = "./artifacts/nuget",
73-
ArgumentCustomization = args =>
74-
args.AppendQuoted($"-p:Version={buildVersion.Version}")
75-
.AppendQuoted($"-p:PackageReleaseNotes={releaseNotes}")
72+
OutputDirectory = "./artifact/nuget",
73+
MSBuildSettings = new DotNetCoreMSBuildSettings()
74+
.WithProperty("Version", buildVersion.Version)
75+
.WithProperty("PackageReleaseNotes", releaseNotes)
7676
});
7777
});
7878

@@ -100,7 +100,7 @@ Task("push")
100100
ApiKey = apiKey,
101101
};
102102

103-
foreach (var nugetPackageFile in GetFiles("./artifacts/nuget/*.nupkg"))
103+
foreach (var nugetPackageFile in GetFiles("./artifact/nuget/*.nupkg"))
104104
{
105105
DotNetCoreNuGetPush(nugetPackageFile.FullPath, nugetPushSettings);
106106
}

0 commit comments

Comments
 (0)