go-semantic-release / semantic-release

πŸ“¦πŸš€ semantic-release written in Go
https://go-semantic-release.xyz
MIT License
404 stars 43 forks source link

Semantic Release does not fetch most recent releases from GitHub #105

Closed timoknapp closed 3 years ago

timoknapp commented 3 years ago

Hi @christophwitzko ,

I just stumpled upon a pretty weird behaviour regarding the way semantic-release fetches the releases of the relevant repository. While using semantic-release with GitLab in production for quite a while now, I just noticed that in GitHub it wont fetch the latest tags (Releases) and therefore wont generate the new semantic-version correctly.

Here is a sample repo of mine:

List of tags

image

When running the action afterwards it does not fetch the latest tag being 1.3.0 and therefore still shows the version 1.2.4. (You can ignore my custom made build numbers +XXX) Also don't bother the execution in dry - mode, its only used for extracting the semantic-version and combine it with the build number.

Semantic Release in GitHub Action

image

I also ran semantic-release locally to be sure that its the same behaviour and unfortunately it is consistent:

image

Do you know where this could be coming from?

Thanks in advance! Timo

christophwitzko commented 3 years ago

Hi @timoknapp, I think this is related to the GitHub provider. Currently the provider ignores annotated tags: https://github.com/go-semantic-release/provider-github/blob/0f1efba09ae5f4cbd961d694d7c6b4af63c1724c/pkg/provider/github.go#L127

I created an issue here: https://github.com/go-semantic-release/provider-github/issues/3

timoknapp commented 3 years ago

Hi @christophwitzko ,

Thanks for the fast reply. Are you already working on a fix for this or is there already a PR upcoming?

EDIT: Maybe I could work around this bug, if there was a way of injecting my build number into the process of generating the semantic-version before it actually creates the new release. Is that already possible?

Regards Timo

christophwitzko commented 3 years ago

Hi @timoknapp,

I looked more into your issue and was not able to reproduce it:

[go-semantic-release]: version: 2.13.0
[go-semantic-release]: ci-condition plugin: default@1.2.2
[go-semantic-release]: provider plugin: GitHub@1.4.1
[go-semantic-release]: getting default branch...
[go-semantic-release]: found default branch: master
[go-semantic-release]: found current branch: master
[go-semantic-release]: found current sha: master
[go-semantic-release]: getting latest release...
[go-semantic-release]: found version: 1.3.1+121
[go-semantic-release]: getting commits...
[go-semantic-release]: analyzing commits...
[go-semantic-release]: commit-analyzer plugin: default@1.3.1
[go-semantic-release]: calculating new version...
[go-semantic-release]: no change

Your tags seem also not annotated, so the provider works fine. Do you still see the error?

timoknapp commented 3 years ago

Hi @christophwitzko ,

haha I already changed the Tags from annotated to lightweight ones πŸ˜‚

In case you want retry, simple create some tags like the following: git tag -fa $TAGNAME

Here is how I created them beforehand:

https://github.com/timoknapp/sound-on-fire/commit/b232a7202798fe0afdef43f10a81b2221bd4f212

Thanks for your support! Timo

christophwitzko commented 3 years ago

Ahhh, okay. πŸ˜… Great, I will work on a fix to support annotated tags. πŸ‘

christophwitzko commented 3 years ago

I will close this issue in favor of https://github.com/go-semantic-release/provider-github/issues/3

christophwitzko commented 3 years ago

@timoknapp The fix is now merged, annotated tags should work now ☺️

timoknapp commented 3 years ago

@christophwitzko

Awesome thanks for the hotfix πŸ‘