Update release tooling to handle both stable and unstable crates (#3082)
## Motivation and Context This PR updates our smithy-rs release tooling to prepare for handling both stable and unstable crates. Merging this PR to `main` does not make any of the runtime crates stable, instead we will just have a supporting mechanism in place, ready to be turned on by implementing `TODO(GA)`. ## Description At a high level, this PR will - update the `Release smithy-rs` workflow UI to have an additional input `Stable semantic version`:  - split an existing gradle property `smithy.rs.runtime.crate.version` into `smithy.rs.runtime.crate.stable.version` and `smithy.rs.runtime.crate.unstable.version`. - make `publisher upgrade-runtime-crates-version` take a new, optional (for backwards compatibility) command line argument `--stable-version` to use the said gradle property `smithy.rs.runtime.crate.stable.version`. This will allow the `publisher` to set a value passed via a workflow input `Stable semantic version` to `smithy.rs.runtime.crate.stable.version` in `gradle.properties` (and the same goes for unstable crates). - update `fixRuntimeCrateVersions` so that it fixes up runtime crate versions based on properties `smithy.rs.runtime.crate.stable.version` and `smithy.rs.runtime.crate.unstable.version`. **NOTE** There is a guard in place. When this PR gets merged and then we enter a stable crate version in the `Stable semantic version` text box, it will be overwritten by a version in `Unstable semantic version`, so that 1.x.y version will NOT be published to `crates.io` before GA and that also replicates today's release workflow's behavior (only publishing unstable crates). Just make sure we specify a 0.x.y in the `Untable semantic version` text box because that does get shipped. ### What happens once `TODO(GA)` has been implemented? Roughly, it will look like this. When we run the `Release smithy-rs` workflow (not a dry-run), providing a stable version (say 1.0.0) and a unstable version (say 0.57.0) in the workflow text boxes, 1. the workflow will create a new release branch `smithy-rs-release-1.x.y`. 2. the workflow will set 1.0.0 to `smithy.rs.runtime.crate.stable.version` and 0.57.0 to `smithy.rs.runtime.crate.unstable.version` in `gradle.properties`. 3. for whatever smithy runtime crates whose package metadata says ``` [package.metadata.smithy-rs-release-tooling] stable = true ``` their `Cargo.toml` will include `version = 1.0.0` (and `version = 0.57.0` if `smithy-rs-release-tooling` is not specified or if its value is `stable = false`). 4. the workflow will publish smithy runtime crates accordingly to `crates.io`. 5. releasing `aws-sdk-rust` subsequently will render `version = 1.0.0` in `Cargo.toml` for stable AWS runtime crates (again as specified by `smithy-rs-release-tooling`), will render `version = 1.1.0` for SDK crates (we will not go into details here as to why it's not `1.0.0`), and will publish those crates to `crates.io`. ## Testing In a [separate branch](https://github.com/awslabs/smithy-rs/tree/ysaito/stable-and-unstable-crates ) that implemented `TODO(GA)`, I verified that - our internal release pipeline was executed without errors - a generated AWS SDK had following manifests (showing excerpts from arbitrary crates) ``` [package] name = "aws-sdk-s3" version = "1.1.0" ``` ``` [package] name = "aws-smithy-types" version = "1.0.0" ``` ``` [package] name = "aws-smithy-http" version = "0.57.0" ``` ``` [package] name = "aws-types" version = "1.0.0" ``` ``` [package] name = "aws-config" version = "1.0.0" ``` ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by:John DiSanti <jdisanti@amazon.com>
Loading
Please register or sign in to comment