rustzx / rustzx

ZX Spectrum emulator written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make release CI workflow

pacmancoder opened this issue · comments

Make CI workflow for releasing new rustzx versions, so new versions could be released more easily. Workflow requirements:

  • Create github releases page with change log and artifacts (use CHANGELOG.md and artifacts produced on the previous steps)
  • Publish all rustzx crates to crates.io (last step)
  • If possible, make draft release for dev branch and promote same release to non-draft when tag is pushed
  • Perform dry run of cargo publish in dev branch
  • If easy to implement, detect changes in crates and fail if forgot to raise version (check in dev branch)

Checklist

  • Check that pending version is bigger than already released
  • Check all publish = true crates version consistency
  • Check that git available
  • Check that user specified all required data (GitHub token, crates.io token, artifacts folder)
  • Check that artifacts folder is not empty
  • check that current commit (git call) exist in remote (via octocrab)
  • check that changelog was updated
  • Add version bump functionality
  • crates are pushed
  • crates pushed in right order (via guppy)
  • create tag from commit (via octocrab GitHub API)
  • create github release
  • Implement --dry-run

Implementation tips:

  • Whole release process can be implemented as rust utility
  • XAMPPRocky/octocrab can be used for GitHub interaction (creating GitHub releases)
  • While in monorepo, all crate versions should be the same before release - utility should validate this (maybe use facebookincubator/cargo-guppy?)
  • Also facebookincubator/cargo-guppy can be used to get cargo publish
  • Utility should validate that all tools and tokens are available before start (git, cargo, GH token, crates.io token)
  • Utility should check that currently running branch is master
  • Utility should check that new version is higher than available on crates.io (or crate is absent, that's handy for new crates)
  • Utility should validate that CHANGELOG.md contains new section for the new release and use it for Github Releases body (body text should be inside <!-- START_RELEASE_NOTES|v0.15.0 --> <!-- END_RELEASE_NOTES -->
  • Utility should have --validate option, to perform all validation steps on the CI for dev/vX.Y.Z branch and master
  • Utility should query GitHub PRs with current branch name and check that if PR contains closes #issue, then changelog should mention it, unless skip_changelog is was for it
  • New manually-triggered GitHub workflow should be added (on master) to perform release remotely

Created separate crate for workspace management (including releases). https://github.com/pacmancoder/cargo-monorepo

Closing for now, most likely, this process will stay semi-manual, but with help of cargo-monorepo tool