Skip to content

Releasing

Christopher Patton edited this page Nov 7, 2022 · 4 revisions

This procedure describes how to release version X.Y.Z.

This procedure requires write access to the repo and the right to push new crates versions to crates.io.

Pre-conditions:

  • Each of the creates has the package version set to X.Y.Z:

    • daphne/Cargo.toml
    • daphne_worker/Cargo.toml
    • daphne_worker_test/Cargo.toml

Instructions:

  1. Create the release branch:

    git checkout main
    git branch release/X.Y.Z
    git push -u origin release/X.Y.Z
    
  2. Create a PR for main that bumps the package versions to X.Y.Z+1. Get the PR approved and merge into main.

  3. Checkout release/X.Y.Z and create a PR for release/X.Y.Z in which all daphne and daphne_worker dependencies are hard-coded to X.Y.Z:

    diff --git a/daphne_worker/Cargo.toml b/daphne_worker/Cargo.toml
    index 8643908..ede3a51 100644
    --- a/daphne_worker/Cargo.toml
    +++ b/daphne_worker/Cargo.toml
    @@ -18,7 +18,7 @@ readme = "../README.md"
     crate-type = ["cdylib", "rlib"]
    
     [dependencies]
    -daphne = { path = "../daphne" }
    +daphne = "X.Y.Z"
     futures = "0.3.25"
     async-trait = "0.1.58"
     base64 = "0.13.1"
    diff --git a/daphne_worker_test/Cargo.toml b/daphne_worker_test/Cargo.toml
    index c8fffad..aa10669 100644
    --- a/daphne_worker_test/Cargo.toml
    +++ b/daphne_worker_test/Cargo.toml
    @@ -19,7 +19,7 @@ test_e2e = []
     test_janus = []
    
     [dependencies]
    -daphne_worker = { path = "../daphne_worker" }
    +daphne_worker = "X.Y.Z"
     cfg-if = "1.0.0"
     worker = "0.0.11"
     serde = { version = "1.0.147", features = ["derive"] }
    @@ -34,7 +34,7 @@ console_error_panic_hook = { version = "0.1.7", optional = true }
     [dev-dependencies]
     assert_matches = "1.5.0"
     base64 = "0.13.1"
    -daphne = { path = "../daphne" }
    +daphne = "X.Y.Z"
     hex = { version = "0.4.3", features = ["serde"] }
     lazy_static = "1.4.0"
     futures = "0.3.25"
    

    Get the PR approved.

  4. Publish the new crates:

    cargo publish --target-dir daphne --dry-run
    cargo publish --target-dir daphne
    cargo publish --target-dir daphne_worker --dry-run
    cargo publish --target-dir daphne_worker
    

    Note that daphne_worker_test is not published, as it is only useful for our own testing purposes.

  5. Merge the PR into release/X.Y.Z.

  6. Tag the release branch:

    git checkout release/X.Y.Z
    git fetch
    git merge origin/release/X.Y.Z
    git tag X.Y.Z
    git push --tags
    

Post-conditions:

  • The version of daphne and daphne_worker on crates.io is X.Y.Z.
  • The version on main is X.Y.Z+1.
  • The release branch has tag X.Y.Z.
Clone this wiki locally