1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-10-31 21:00:51 +01:00

ci: don't push on pull request

This commit is contained in:
Ell 2023-09-06 12:42:47 +02:00
parent b49ac1d053
commit 1a06bcc7fd

View file

@ -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,7 +49,10 @@ 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")
.WithCriteria(branch == "main" || branch == "release", "Not on main or release branch")
.WithCriteria(string.IsNullOrEmpty(EnvironmentVariable("CI_COMMIT_PULL_REQUEST")), "On pull request")
.IsDependentOn("Pack").Does(() => {
DotNetNuGetPushSettings settings; DotNetNuGetPushSettings settings;
if (branch == "release") { if (branch == "release") {
settings = new DotNetNuGetPushSettings { settings = new DotNetNuGetPushSettings {