Skip to content
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

feat: Transparent release process #480

Closed
wants to merge 3 commits into from
Closed

feat: Transparent release process #480

wants to merge 3 commits into from

Conversation

bonddim
Copy link
Contributor

@bonddim bonddim commented Jul 3, 2023

  • Added goreleaser config
  • Add release workflow

@mumoshu
Copy link
Collaborator

mumoshu commented Jul 25, 2023

@bonddim Thanks! Just wondering, how did you test this?! If you've already run goreleaser using this config on your repo, I'd love it if you could share it for review 🙏

@bonddim
Copy link
Contributor Author

bonddim commented Jul 25, 2023

@mumoshu Sure,
Published release
Workflow run.

Note that this was first tag in my forked repo, that's why goreleaser fill changelog with a lot of commits.

Copy link
Collaborator

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!
I wanted to introduce MVP of release automation and do incremental enhancements on top of that, and #517 is my first attempt.
I've commented on this PR to note differences. If you are still around, I'd love your confirmation and feedback!

archives:
- format: tgz
name_template: '{{ .ProjectName }}-{{ tolower .Os }}-{{ .Arch }}'
wrap_in_directory: diff
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we don't need this wrapping, because our installation script doesn't expect it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All files in latest release are wrapped into diff directory, and installation script uses it :

HELM_TMP_BIN="$HELM_TMP/diff/bin/diff"

Copy link
Collaborator

@mumoshu mumoshu Jan 12, 2024

Choose a reason for hiding this comment

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

You are absolutely correct @bonddim! Thank you very much for the confirmation and the correction. You saved the day!

snapshot:
name_template: '{{ incpatch .Version }}-{{ .ShortCommit }}'

changelog:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I missed this in my PR so let me check later!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't required for releases, but I like this snapshot versioning


archives:
- format: tgz
name_template: '{{ .ProjectName }}-{{ tolower .Os }}-{{ .Arch }}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is correct - I missed this.

- darwin_arm64
- linux_386
- linux_amd64
- linux_arm
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm not missing anything, we can safely omit 386, arm, ppc64le and s390x "yet" as we don't publish binaries for those archs today.

Copy link
Contributor Author

@bonddim bonddim Jan 11, 2024

Choose a reason for hiding this comment

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

Just included all architectures supported by Helm.
Yes, its safe to omit them, but why to not include them now?

@@ -8,4 +8,3 @@ fi

git tag $1
git push origin $1
gh release create $1 --draft --generate-notes --title "$1" release/*.tgz
Copy link
Collaborator

@mumoshu mumoshu Jan 12, 2024

Choose a reason for hiding this comment

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

Good catch! Today, the release process looks like the below:

  • Add a commit that updates plugin.yaml to have a new version
  • Run this release.sh

After this and #517, the process would look like:

  • Add a commit that updates plugin.yaml to have a new version
  • Run this script, or create a semver tag along with the release on the GitHub web UI
  • The workflow gets triggered on GHA. goreleaser does the rest.

I guess we'd rather prefer the below:

  • Add a commit that updates plugin.yaml to have a new version
  • A GHA workflow reads the new plugin.yaml version value and tags the commit with the version
  • The release workflow gets triggered and goreleaser does the rest.

Maybe we can modify this release.sh to do the second bullet point?
Basically, we can deduce $1 here from plugin.yml by reading the version field using eg. yq? 🤔

mumoshu added a commit that referenced this pull request Jan 13, 2024
* Automate releases using GHA

To publish a release, we currently have to run `make docker-run-release` locally after tagging a release, which is not a huge effort but a bit cumbersome, because we do it only a few times a year and that is long enough to lose my memory :)

Starting this change, we use a GHA workflow to automatically build and publish binaries whenever a new semver tag is created, so that we do not need to run `make` anymore.

* Applies bonddim's suggestion. Thx!

* We do have to wrap files in the diff dir. See #480 (comment)
@bonddim bonddim closed this Jan 13, 2024
@bonddim bonddim deleted the goreleaser branch January 17, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants