How to structure GitHub actions to bump package version, publish to Hex and update changelog

Hey everyone :wave: I’m building my first open-source library with Elixir, and would like some guidance on how to create a GitHub action for a version release, to essentially not having to do that manually.

Nowadays we have a patch version, and every time that I need do perform a version bump, it’s required to create a PR to manually update the, mix.ex, and then publish it to Hex.

The ideal DX would be to trigger a GitHub action that would do all of that stuff automatically:

  • Bump version on mix.ex
  • Publish to Hex
  • Update

Also, another thing to consider is how to differentiate between a major, minor, and patch version bump.

Does anyone have experience in creating a type of action with those steps? Are there suggestions of tools for that?

1 Like

I found this library called GitHub - zachdaniel/git_ops: A tool for version and changelog management in Elixir via conventional commits., wondering if I could trigger that on a GitHub action and it would perform all of those steps.

1 Like

Personally I would set a pipeline that would trigger when a push with tag happens, not sure how exactly that works with github. The only thing you have to manage manually is the actual version from mix.exs.