-
Notifications
You must be signed in to change notification settings - Fork 94
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
add workflow and documentation for OCI release #54
base: main
Are you sure you want to change the base?
Conversation
run: | | ||
helm push \ | ||
"mastodon-${GITHUB_REF_NAME#v}.tgz" \ | ||
"oci://ghcr.io/$GITHUB_REPOSITORY_OWNER/charts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will result in a final URL of ghcr.io/mastodon/charts/mastodon
, because helm push
automatically appends the name of the chart after this URL. Tag is automatically set by helm push
from the chart version.
--password-stdin | ||
- name: Helm package | ||
run: | | ||
helm package . -u --version "${GITHUB_REF_NAME#v}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chart versions should not have a leading v
, so we strip it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
40ad781
to
a141a4f
Compare
this is great, but i don't understand the rationale for setting the chart version to |
@dunn The rationale is mainly to avoid having two sources of truth for the version (tag and file), which can easily get out of sync. Additionally, having to make a commit updating the version on a file adds extra steps to the release process, and adds friction to every rebase. Is there any benefit from having the version in-tree? Keep in mind that the way it is done right now, |
it's not a hill i'll die on, but i think it's useful to have it in the repository as a reference, and if we're manually tagging anyway it (hopefully) won't be hard to forget to increment. (Alternatively we could set up a release script to manage both.) |
This PR proposes an alternative, and allegedly simpler and more modern approach to releasing this chart for easier consumption by users.
The problem
So far, the mastodon chart is not packaged in any way, making its use cumbersome. In my personal case, I need to have a hacky shell script downloading the latest
.tar.gz
from this repo and copying it to acharts/
directory by hand.Alternative solutions
chart-releaser has been the de-facto standard for releasing charts for a long time. However, it has, in my view, several limitations:
main
. This makes hard to control when features are released.Chart.version
. This means contributors need to bump this themselves, adding friction.This approach
For a long time, helm itself has supported publishing charts to OCI registires. I think this feature is awesome but for some reason it has not been widely adopted by the community yet. This PR implements that very same approach, which is simple and straightforward to implement, use, and understand.
How it works
First the
version
filed inChart.yaml
is set to0.0.0
. Maintainers or contributors do not need to touch this field anymore (but.Chart.Version
will keep working in templates). Releases are triggered by creating a release in github, as it is customary with Github projects. The version of the chat is trivially derived from the tag that accompanies that version (e.g., releasev4.0.0
will produce a chart version4.0.0
). This number is used by thehelm package
command to produce a chart package which is later pushed toghcr.io
as if it were a docker image.Users can install the chart or add it as a dependency as normal, using
oci://ghcr.io/mastodon/charts/mastodon
as the chart url.Other comments
I understand this is pretty much a maintainer decision, so It's okay if you don't like it. I opted for jumping directly with a PR because it took me very little time to adapt this workflow from other charts I manage, and because I think it's useful to "let the code do the talking". Looking forward to hear your thoughts!
Closes #27