Skip to content

Release Process

Frances Wingerter edited this page Jun 2, 2023 · 7 revisions

So you want to make a new release of C2Rust? Well, here's (generally) how we do that.

First, you will need to be an owner of the relevant crates on crates.io. Any existing owner can invite you, please contact one of the owners listed on the crate's crates.io page.

Release Checklist

Based on https://dev.to/sharkdp/my-release-checklist-for-rust-programs-1m33

  1. Check and update dependencies

    • Check cargo outdated (cargo outdated -R)
    • Run cargo update
    • Manually update to new revisions (if needed)
  2. Clean up code base

    • Review cargo clippy output
    • Run cargo fmt
    • Run tests
  3. Bump version

    • Update versions in Cargo.tomls
    • Run cargo build to update Cargo.lock
  4. Compile release notes

  5. Update documentation

    • Review and update command usage
    • Update main README
    • Review manual and update if needed
  6. Install and test the master locally

    • cargo +stable install -f --path c2rust
    • Test new features
    • Run benchmarks?
  7. Run package script check

    ./scripts/package.py --version x.y.z check
    

    fw (01/28/2023) - this script was broken by #804

  8. Dry run publish

    cargo publish --dry-run --allow-dirty
    

    fw (01/28/2023) - this does not work with a Cargo workspace. running with -p for each crate also doesn't work because cargo publish uses versions over path dependencies, but our intra-workspace deps have not actually been published yet

  9. Commit, push, pass CI, merge

  10. Create release on github (with release notes)

    Create a git tag through the GH release UI.

  11. Verify github deployment

    fw (01/28/2023) - what does this mean?

  12. Publish to crates.io

    The package.py script can do this with publish, but it also tries to tag a release at the same time. It's currently easier to just cargo publish -p $crate manually in the correct reverse dependency order until we fix up the script.

    Note that cargo publish requires cargo login or to have CARGO_REGISTRY_TOKEN set in the environment.

    fw (01/28/2023) - skip crates excluded in the top-level Cargo.toml

    #!/bin/sh
    
    # reverse topological order:
    order=(
        c2rust-asm-casts
        c2rust-ast-builder
        c2rust-ast-printer
        c2rust-build-paths
        c2rust-ast-exporter
        c2rust-bitfields-derive
        c2rust-bitfields
        c2rust-transpile
        c2rust
    )
    
    for crate in ${order[@]}; do
        cargo publish -p $crate || break
    done
Clone this wiki locally