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

Automate releases using GHA #517

Merged
merged 3 commits into from
Jan 13, 2024
Merged

Automate releases using GHA #517

merged 3 commits into from
Jan 13, 2024

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Jan 10, 2024

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 and goreleaser to automatically build and publish binaries whenever a new semver tag is created, so that we do not need to run make anymore.

I crafted the goreleaser configuration so that it produces the same archives that we use and helm-diff's install.sh relies on.

For example, the produced archives has contents like the below:

  • plugin.yaml
  • README.md
  • LICENSE
  • bin/diff

bin/diff is especially important because that's the path we use in the plugin.yaml.

You can test this almost locally, by running goreleaser --snapshot --clean. Whenever you modify .goreleaser.yml, I'd recommend you running that for verification.

I bootstraped this from my other projects. But the end result turned out to be almost the same as @bonddim's awesome PR #480 submitted last July(!) so big applause to @bonddim for his awesome work!

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.
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20.12'
Copy link

Choose a reason for hiding this comment

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

I'd rather use go-version-file: 'go.mod'
You don't need to update workflow in case of go patch version bump.

Copy link
Collaborator

Choose a reason for hiding this comment

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

good idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated in 6ab9a0b. Thank you very much for the suggestion ☺️

Copy link
Collaborator

@yxxhero yxxhero left a comment

Choose a reason for hiding this comment

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

LGTM

@mumoshu mumoshu merged commit d62e364 into master Jan 13, 2024
10 checks passed
@mumoshu mumoshu deleted the release-automation-gha branch January 13, 2024 05:38
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.

3 participants