mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 04:53:29 +01:00
ci: don't push on pull request
This commit is contained in:
parent
b49ac1d053
commit
1a06bcc7fd
1 changed files with 19 additions and 16 deletions
35
build.cake
35
build.cake
|
@ -15,7 +15,7 @@ Task("Prepare").Does(() => {
|
||||||
|
|
||||||
if (branch != "release") {
|
if (branch != "release") {
|
||||||
var buildNum = EnvironmentVariable("CI_PIPELINE_NUMBER");
|
var buildNum = EnvironmentVariable("CI_PIPELINE_NUMBER");
|
||||||
if (buildNum != null)
|
if (!string.IsNullOrEmpty(buildNum))
|
||||||
version += "-ci." + buildNum;
|
version += "-ci." + buildNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,21 +49,24 @@ Task("Pack").IsDependentOn("Test").Does(() => {
|
||||||
DotNetPack("MLEM.FNA.sln", settings);
|
DotNetPack("MLEM.FNA.sln", settings);
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Push").WithCriteria(branch == "main" || branch == "release").IsDependentOn("Pack").Does(() => {
|
Task("Push")
|
||||||
DotNetNuGetPushSettings settings;
|
.WithCriteria(branch == "main" || branch == "release", "Not on main or release branch")
|
||||||
if (branch == "release") {
|
.WithCriteria(string.IsNullOrEmpty(EnvironmentVariable("CI_COMMIT_PULL_REQUEST")), "On pull request")
|
||||||
settings = new DotNetNuGetPushSettings {
|
.IsDependentOn("Pack").Does(() => {
|
||||||
Source = "https://api.nuget.org/v3/index.json",
|
DotNetNuGetPushSettings settings;
|
||||||
ApiKey = EnvironmentVariable("NUGET_KEY")
|
if (branch == "release") {
|
||||||
};
|
settings = new DotNetNuGetPushSettings {
|
||||||
} else {
|
Source = "https://api.nuget.org/v3/index.json",
|
||||||
settings = new DotNetNuGetPushSettings {
|
ApiKey = EnvironmentVariable("NUGET_KEY")
|
||||||
Source = "https://nuget.ellpeck.de/v3/index.json",
|
};
|
||||||
ApiKey = EnvironmentVariable("BAGET_KEY")
|
} else {
|
||||||
};
|
settings = new DotNetNuGetPushSettings {
|
||||||
}
|
Source = "https://nuget.ellpeck.de/v3/index.json",
|
||||||
settings.SkipDuplicate = true;
|
ApiKey = EnvironmentVariable("BAGET_KEY")
|
||||||
DotNetNuGetPush("**/MLEM*.nupkg", settings);
|
};
|
||||||
|
}
|
||||||
|
settings.SkipDuplicate = true;
|
||||||
|
DotNetNuGetPush("**/MLEM*.nupkg", settings);
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Document").Does(() => {
|
Task("Document").Does(() => {
|
||||||
|
|
Loading…
Reference in a new issue