-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Releasing a new version will not post to twitter on GH-Actions #738
Comments
@AdmiringWorm you do have projects with |
@nils-a I personally haven't moved any project to GitHub fully yet, as there was an ongoing issue with GitVersion which was making it not work properly on tagged builds. I think this has now been addressed though, but not started the process of moving over yet. |
I see. (Probably should continue my tests on appVeyor, then 😄 ) Nonetheless this issue would make moving difficult, too. |
Sounds like a potential candidate for investigating on stream... This is something that I would like to get working, as a lot of work was done to get the support for different build providers. |
Good idea. I am certain I found the "error" (not sure about a fix, though). If you compare in Not sure about a fix though. According to the docs I fear the "original" branch is not provided to us. |
Different use case for both of them, 1 is for the tags the other for branch names. They aren't meant to be equal. The problem is github actions itself, when it checks out a tag it checks it out in a detached state, without having a reference to the actual branch name of the commit (same thing happens on appveyor if you create a tag manually and push it, instead of creating it through the github UI). I have seen this happen, on my own projects, but haven't found a solution other than using gha for most commits, but appveyor on a tagged commit. The problem with it not sending the twitter message is due to the above and to the criteria here: Cake.Recipe/Cake.Recipe/Content/build.cake Lines 31 to 33 in f7b0621
Since it isn't possible to detect the git branch (at least I haven't found out how) on tagged releases, this evaluates to false every time and sending messages is disabled. |
@AdmiringWorm agreed. However: Lines 5/6 says:
So we're using line 31 uses the exact same thing (environment variable) i.e. Both can not be true at the same time. Or am I missing something? |
Nope, you are correct, however the Ref will always be a tag for tagged builds (and BaseRef will be empty). This is unfortunately a limitation on the GitHub action though. |
If tag is being built on GitHub actions, additional work is required in order to find the branch name.
We tackled this on the stream tonight, and we have a working solution that correctly identifies that branch name, based on using In order for this to work, the following is required in the workflow file:
|
@gep13 @AdmiringWorm I think we fixed this only for non-windows systems (And I think we checked only ubuntu yesterday). If you check the ubuntu run from yesterday at https://github.com/gep13/CakeRecipeGHA/runs/1646503805?check_suite_focus=true#step:5:536 it reads:
compare that with the windows run at https://github.com/gep13/CakeRecipeGHA/runs/1646503796?check_suite_focus=true#step:5:750. It reads:
and this run also results in |
to all cases of resolving "git" to make them work on windows.
🎉 This issue has been resolved in version 2.2.0 🎉 The release is available on: Your GitReleaseManager bot 📦🚀 |
I experienced this error (no twitter message sent, when it should be) when releasing
test-rider
usingCake.IntelliJ.Recipe
(see the ubuntu run, there). I started analyzing for https://github.com/nils-a/Cake.IntelliJ.Recipe/issues/14.While analyzing, I came across this in the logs:
which explains that the post was not made:
build.cake
sends all messages only forBranchType.Master
(orBranchType.Release
orBranchType.HotFix
whenBuildParameters.ShouldNotifyBetaReleases
is set.)I compared to Cake.7zip and Cake.asciidoctorj (both have appVeyor as
preferredBuildProviderType
so I never noticed the problem there...) and every build in GH-Actions that is based on a tag, hasBranchType
set toUnknown
. ("Every" being based on my sample of three.)Compared to builds on appVeyor this seems to be the error. Builds on appVeyor that are tag-builds have
BranchType
set corresponding to the branch being tagged. I.e.Master
for the above mentioned cases of Cake.7zip and Cake.asciiddoctorj.I think the culprit is
context.BuildSystem().GitHubActions.Environment.Workflow.Ref
ingithub-actions.cake
: For tagged builds on GH-Actions,ref
is the tag-name. I.e.refs/tags/0.2.0
for the release build oftest-rider
.The text was updated successfully, but these errors were encountered: