asciidoctor / asciidoctor-chart

A set of Asciidoctor extensions that add a chart block and block macro to AsciiDoc for including charts in your AsciiDoc document.
Other
29 stars 13 forks source link

Automate the release process to publish to rubygems when a new release is created on GitHub #40

Open ggrossetie opened 1 year ago

ggrossetie commented 1 year ago

Currently, we need to manually update the version in:

https://github.com/asciidoctor/asciidoctor-chart/blob/0b82c79785d20dabd66435b6698e3d483b25e3b3/lib/asciidoctor/chart/version.rb#L5

Then, run bundle exec rake and push these changes.

And, we also need to update the CHANGELOG.adoc.

B3nedikt commented 1 year ago

Something like this: #41 Assumes no one changes the version.rb file, the line based replacement could be exchanged with a regex or a bit of awk. But this then assumes no one changes the name of the variable or removes the version.rb file... Also one could use the github-push-action for pushing and give the bot a nice name. I am not really a fan of introducing tons of actions for trivial things though ;)

mojavelinux commented 1 year ago

I strongly recommend using the workflow I have set up for other packages in the Asciidoctor org. Here's how it works:

  1. Run a Release workflow (from the GitHub Actions tab) and specify a version (it will auto-select the next patch version if not specified)
  2. Configure the workflow to run the release script (see https://github.com/asciidoctor/asciidoctor-tabs/blob/main/release.sh for an example)

This process is working incredibly well for me. Since implementing it, I have released more software than I ever have before. I'm now making several releases a week instead of waiting several months between each release.

I do plan to wrap up that release script into a shared repo so it can be reused. But, at the end of the day, it's working and Bash just does it better.

mojavelinux commented 1 year ago

Then, run bundle exec rake and push these changes.

I strongly recommend against doing any part of the release from your local machine. There are two reasons for this. First, it's opaque. A workflow in the GitHub Actions interface is more transparent and guided. Second, you are going to run some sort of release script anyway, so you might as well do the release end to end from the same place.

B3nedikt commented 1 year ago

How about creating a composite action from the workflow in the asciidoctor-tabs repository?

mojavelinux commented 1 year ago

I don't want to do that right now, but I will extract this script to somewhere reusable when I have the time.

B3nedikt commented 1 year ago

If it is a time issue, I could implement it, it is relatively simple to do. Or do you think just copy & paste of the script into this repository and changing the workflow to use the script is the better option for now?

mojavelinux commented 1 year ago

For now, I would prefer that the script be copied into the repository. There's no need to over-complicate this.

I have numerous release scripts and I want to bring them together into a single shared repository. Once I do that, then we can switch over to pulling it from there. But I'm still haven't decided yet how they will be consumed and I don't want to rush it.