Skip to content

Commit 7a9745e

Browse files
authored
Add buildkite pipeline and cake taks for publishing nuget packages (#15)
1 parent 7329684 commit 7a9745e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

build.cake

+14-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ var KOTLINSTDLIBCOMMONURL = $"http://search.maven.org/remotecontent?filepath=org
3434
var KOTLIANNOTATIONSURL = $"http://search.maven.org/remotecontent?filepath=org/jetbrains/annotations/{KOTLIANNOTATIONS_VERSION}/annotations-{KOTLIANNOTATIONS_VERSION}.jar";
3535
var YEARCLASSURL = $"http://search.maven.org/remotecontent?filepath=com/facebook/device/yearclass/yearclass/{YEARCLASS_VERSION}/yearclass-{YEARCLASS_VERSION}.jar";
3636

37+
var NUGET_API_KEY = EnvironmentVariable("NUGET_API_KEY");
38+
3739
Task ("FetchDependencies")
3840
.Does (() => {
3941
// PSPDFKit.Android
@@ -118,6 +120,17 @@ Task ("NuGet")
118120
});
119121
});
120122

123+
Task ("NuGet-Push")
124+
.IsDependentOn("Nuget")
125+
.Does (() =>
126+
{
127+
var package = "./nuget/pkgs/PSPDFKit.Android." + PSPDFKIT_VERSION +".nupkg";
128+
NuGetPush(package, new NuGetPushSettings {
129+
Source = "https://api.nuget.org/v3/index.json",
130+
ApiKey = NUGET_API_KEY
131+
});
132+
});
133+
121134
Task ("Clean")
122135
.Does (() => {
123136
if (FileExists ("./PSPDFKit.Android.dll"))
@@ -161,4 +174,4 @@ Task ("Clean-obj-bin")
161174
}
162175
});
163176

164-
RunTarget (target);
177+
RunTarget (target);

ci/pipelines/release.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
steps:
2+
- label: 'Build Nuget Packages'
3+
command: '( ./build.sh --Target=Nuget )'
4+
agents:
5+
macos: true
6+
7+
- wait
8+
9+
- block: ':rocket: Release'
10+
11+
- label: 'Upload Nuget Packages'
12+
command: '( ./build.sh --Target=Nuget-Push)'
13+
agents:
14+
macos: true

0 commit comments

Comments
 (0)