Skip to content

Add releases for main & maintenance branches #13829

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

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

wojtekmach
Copy link
Member

@wojtekmach wojtekmach commented Sep 16, 2024

Before this patch, release.yml workflow was only compiling and publishing builds on tag pushes.

This patch additionally handles branch pushes (main, v1.17, etc) and publishes them to corresponding releases (main-latest, v1.17-latest, etc).

When we first looked at using GitHub releases for main builds, we discarded the idea because we didn't want to keep re-creating (and thus sending out notifications) releases. There was no API to update the SHA the release was pointing to either. It's obvious in hindsight but all we need to do is to update the tag with the latest SHA and force-push the tag that the release is pointing to. So it is logically the same release but we update the SHA (through tag) and upload updated release assets.

Demo:

image

We now have two places where we build main and maintenance branches, release.yml and builds.hex.pm.yml, so in future commits we should look into unifying the two.

Before this patch, release.yml workflow was only compiling and
publishing builds on tag pushes.

This patch additionally handles branch pushes (main, v1.17, etc) and
publishes them to corresponding releases (main-latest, v1.17-latest,
etc).

When we first looked at using GitHub releases for main builds, we
discarded the idea because we didn't want to keep re-creating (and thus
sending out notifications) releases. There was no API to update the SHA
the release was pointing too either. It's obvious in hindsight but all
we need to do is to update the _tag_ with the latest SHA and force-push
the tag that the release is pointing to.

We now have two places where we build main and maintenance branches,
release.yml and builds.hex.pm.yml, so in future commits we should look
into unifying the two.
@wojtekmach
Copy link
Member Author

wojtekmach commented Sep 16, 2024

@wingyplus any feedback on this would be very appreciated. If this lands, perhaps you'd be interested in helping out with unifying release.yml and builds.hex.pm.yml? I think we can have a single workflow where we precompile per OTP once and publish the exact same artifacts to GitHub releases and builds.hex.pm.

@wojtekmach
Copy link
Member Author

One more demo, from my fork: https://github.com/wojtekmach/elixir/releases

@wojtekmach
Copy link
Member Author

cc @tsloughter

@tsloughter
Copy link
Contributor

Are you able to tell it to not add the latest label in github to these new releases? I'll check the api now.

@tsloughter
Copy link
Contributor

Ah yup. Can you add --latest=false to these?

@tsloughter
Copy link
Contributor

Side question: Does Elixir do any backporting of fixes? Like are releases of older versions still being done? Like Erlang does but you can see that the latest 26 release is not latest, it remains on 27: https://github.com/erlang/otp/releases

@wojtekmach
Copy link
Member Author

I added —-latest=false, thanks!

yes, Elixir is backporting some fixes on eg v1.17 and similar branches and cuts eg v1.17.(n+1) off of it.

@wojtekmach
Copy link
Member Author

We now publish releases off git tags on CI so maintenance releases would by default be marked as latest which is not what we want. I can look into conditionally doing that when they are in fact latest.

—-latest=false \
--title $ref_name \
--notes "Automated release for latest ${{ github.ref_name }}." \
|| true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't ignore this step, right? The prebuilt step requires the release to be presented.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this particular gh release create will succeed only ever once per branch so I thought it's OK to ignore errors. I could make it more explicit or at least add a comment though.

@josevalim josevalim merged commit 69ad427 into elixir-lang:main Sep 16, 2024
9 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@wojtekmach wojtekmach deleted the wm-build-main-latest branch September 16, 2024 20:37
@wingyplus
Copy link
Contributor

@wingyplus any feedback on this would be very appreciated. If this lands, perhaps you'd be interested in helping out with unifying release.yml and builds.hex.pm.yml? I think we can have a single workflow where we precompile per OTP once and publish the exact same artifacts to GitHub releases and builds.hex.pm.

@wojtekmach will help looking into this. 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants