From 8b5764f207332d1ebe618f6898d860717c3cdb04 Mon Sep 17 00:00:00 2001 From: "L. Ellenbeck" <ellenbeck@itc.rwth-aachen.de> Date: Wed, 22 Jan 2020 14:52:08 +0100 Subject: [PATCH] Fix: more fixes --- build.cake | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/build.cake b/build.cake index 10c0811..66819ec 100644 --- a/build.cake +++ b/build.cake @@ -219,29 +219,8 @@ IEnumerable<string> redirectedStandardOutput; } description += "\n"; } - } - - /*exitCodeWithArgument = - StartProcess( - "git", - new ProcessSettings { - Arguments = $"tag v{semanticVersion}", - RedirectStandardOutput = true - }, - out redirectedStandardOutput - ); - - exitCodeWithArgument = - StartProcess( - "git", - new ProcessSettings { - Arguments = $"push \"https://gitlab-ci-token:{gitlabToken}@git.rwth-aachen.de/{gitlabProjectPath}.git\" HEAD:master --tags", - RedirectStandardOutput = true - }, - out redirectedStandardOutput - );*/ - - + } + // create tag var settings = new HttpSettings { Headers = new Dictionary<string, string> @@ -250,17 +229,25 @@ IEnumerable<string> redirectedStandardOutput; }, EnsureSuccessStatusCode = true, }; - - // create tag + settings.SetJsonRequestBody("{}"); var responseBody = HttpPost($"https://git.rwth-aachen.de/api/v4/projects/{gitlabProjectId}/repository/tags?tag_name=v{semanticVersion}&ref=master&release_description={description}", settings); - Information(responseBody); + Information("Create tag: {0}", responseBody); // create release + var settings = new HttpSettings + { + Headers = new Dictionary<string, string> + { + {"PRIVATE-TOKEN", gitlabToken}, + }, + EnsureSuccessStatusCode = true, + }; + var json = $"{{\"name\": \"v{semanticVersion}\", \"tag_name\": \"v{semanticVersion}\" \"description\": \"{description}\"}}"; settings.SetJsonRequestBody(json); responseBody = HttpPost($"https://git.rwth-aachen.de/api/v4/projects/{gitlabProjectId}/releases", settings); - Information(responseBody); + Information("Create release: {0}", responseBody); }); Task("Build") -- GitLab