From 95da0a3602ade1cce8599422b96ff128070a77c4 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Thu, 25 Jan 2024 15:48:03 +0800 Subject: [PATCH] scripts/snap_release: chk mirror only if GitLabCI This used to be a check needed for when GitLabCI was in charge of generating snap packages, and GitHub was only our mirror (now it is our gitlab repo the one that is a mirror, so this code should not run normally; at least not in a GitHubActions job). --- scripts/snap_release.fsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/snap_release.fsx b/scripts/snap_release.fsx index b8cf74b5e..4c8dce248 100755 --- a/scripts/snap_release.fsx +++ b/scripts/snap_release.fsx @@ -52,17 +52,6 @@ let orgOrUsername, repoName = orgOrUsername, repoName let webClient = new WebClient() -let mirror = sprintf "https://github.com/%s/%s" orgOrUsername repoName -try - webClient.DownloadString mirror - |> ignore -with -| _ -> - Console.Error.WriteLine( - sprintf "Some problem while retrieving '%s', did you set up a mirror properly from GitLab to GitHub?" - mirror - ) - let snapFiles = FsxHelper.RootDir.EnumerateFiles().Where(fun file -> file.Name.EndsWith ".snap") if not (snapFiles.Any()) then Console.Error.WriteLine "No snap package found." @@ -84,6 +73,18 @@ let gitProvider = else failwith onlyCiMsg +if gitProvider = GitLab then + let mirror = sprintf "https://github.com/%s/%s" orgOrUsername repoName + try + webClient.DownloadString mirror + |> ignore + with + | _ -> + Console.Error.WriteLine( + sprintf "Some problem while retrieving '%s', did you set up a mirror properly from GitLab to GitHub?" + mirror + ) + Console.WriteLine "Checking if this is a tag commit..." let gitTag =