kivikakk / comrak

CommonMark + GFM compatible Markdown parser and renderer
Other
1.17k stars 140 forks source link

Add automation to release new crates #374

Closed gjtorikian closed 5 months ago

gjtorikian commented 5 months ago

👋 This is an automation to make cutting new releases a little easier. It's a variation on a workflow I use in my Ruby gem releases.

Note that this release workflow only executes manually, ie. you have to still push the Release workflow button:

Screenshot 2024-04-09 at 07 53 58

Step by step, it:

  1. Grabs the repo, sets up rust
  2. Gets the current version of the project defined in Cargo.toml
  3. Generates a changelog/readme
  4. Pushes those to the repo
  5. Publishes the crate
  6. Creates a tag, and publishes the release on GitHub

Along the way, I also see the opportunity to add more automations around dependency management.

I haven't tested this yet, but I will do so by changing the version number to something like 0.$LATEST.0.alpha if the PR is desired!

github-actions[bot] commented 5 months ago
Command Mean [ms] Min [ms] Max [ms] Relative
./bench.sh ./comrak-34b110b 323.8 ± 1.8 321.0 328.1 2.82 ± 0.08
./bench.sh ./comrak-main 322.4 ± 1.7 319.9 326.4 2.80 ± 0.08
./bench.sh ./pulldown-cmark 115.0 ± 3.1 112.8 127.8 1.00
./bench.sh ./cmark-gfm 119.1 ± 3.1 116.7 130.0 1.04 ± 0.04
./bench.sh ./markdown-it 481.0 ± 2.7 475.6 487.5 4.18 ± 0.12

Run on Tue Apr 9 12:00:33 UTC 2024

kivikakk commented 5 months ago

This looks lovely! It'd be great to see a test run.

Also, looks like there's still some Rubygems stuff in the publish job?

gjtorikian commented 5 months ago

It'd be great to see a test run.

I swear this isn't a social engineering phishing attempt! 😅 But I just realized I don't have the ability to add secret tokens to this repo, so I can't add my own crates.io API key to use here—so it won't ever publish.

If you could add CRATES_IO_TOKEN as a secret variable, I can move forward with testing the run!

kivikakk commented 5 months ago

😅 Done!

gjtorikian commented 5 months ago

Sigh. Looks like you can't manually run a workflow—even if it's set to workflow_dispatch—until it's merged in the main branch.

In theory, I think all of this ought to work. Happy to make changes, and then once it's merged, actually attempt the automation? I'm not sure how else to test this.

kivikakk commented 5 months ago

Of course, please go ahead!