Skip to content

Commit

Permalink
scripts/snap_release: chk mirror only if GitLabCI
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
knocte committed Jan 25, 2024
1 parent 4ead1a0 commit 95da0a3
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions scripts/snap_release.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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 =
Expand Down

0 comments on commit 95da0a3

Please sign in to comment.