Skip to content

Commit

Permalink
build.fsx,RELEASE.md: don't push prereleases for relNotes commits
Browse files Browse the repository at this point in the history
The way we had setup the prerelease push was making unnecessary prerelease
packages for the same commit that ends up being mapped to a release. But if
we push the tag and the branch at the same time, and check the commit with
'git describe' then we can detect the situation and avert it.
  • Loading branch information
knocte committed Dec 22, 2023
1 parent d07553d commit fa788db
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,22 @@ Target.create "Push" (fun _ ->
| None ->
Console.WriteLine "No nuget-key env var found, skipping..."
| Some key ->
push key
if isTag then
push key
else
match getBuildParam "GITHUB_SHA" with
| None ->
failwith "GITHUB_SHA should have been populated"
| Some commitHash ->
let gitArgs = sprintf "describe --exact-match --tags %s" commitHash
let proc =
CreateProcess.fromRawCommandLine "git" gitArgs
|> Proc.run
if proc.ExitCode <> 0 then
// commit is not a tag, so go ahead pushing a prerelease
push key
else
Console.WriteLine "Commit mapped to a tag, skipping pushing prerelease..."
| _ ->
Console.WriteLine "Github event name not 'push', skipping..."

Expand Down

0 comments on commit fa788db

Please sign in to comment.