Unverified Commit 6143d901 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Enable independent crate versioning for SDK crates (#1540)

* Update `hydrate-readmes` to take versions from `versions.toml`
* Add cleanup TODO comments to `changelogger`
* Update SDK readme template
* Split up `generate-version-manifest` subcommand
* Eliminate the `aws.sdk.version` property
* Fallback to model hash comparison if model metadata claims no changes
* Add `acquire-base-image` to `release.yml`
* Use empty model metadata for SDK generation in CI
* Fix the `aws-config` version number in SDK crate readmes
parent 298748a6
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -23,13 +23,38 @@ on:
        default: true

jobs:
  # If a release is kicked off before an image is built after push to main,
  # or if a dry-run release is kicked off against a non-main branch to test
  # automation changes, we'll need to build a base image to work against.
  # This job will be a no-op if an image was already built on main.
  acquire-base-image:
    name: Acquire Base Image
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
      with:
        path: smithy-rs
        fetch-depth: 0
    - name: Acquire base image
      id: acquire
      run: ./smithy-rs/tools/ci-build/acquire-build-image
    - name: Upload base image
      uses: actions/upload-artifact@v3
      with:
        name: smithy-rs-base-image
        path: smithy-rs-base-image
        retention-days: 1

  release-ci:
    name: Prerelease checks
    needs:
    - acquire-base-image
    uses: ./.github/workflows/ci.yml

  release:
    name: Release
    needs:
    - acquire-base-image
    - release-ci
    runs-on: ubuntu-latest
    steps:
+12 −0
Original line number Diff line number Diff line
@@ -104,3 +104,15 @@ async fn main() -> Result<(), aws_sdk_dynamodb::Error> {
references = ["aws-sdk-rust#567"]
meta = { "breaking" = false, "tada" = true, "bug" = false }
author = "Velfi"

[[aws-sdk-rust]]
message = """
Until now, SDK crates have all shared the exact same version numbers.
This changes with this release. From now on, SDK crates will only version
bump if they have changes. Coincidentally, they may share the same version
number for some releases since changes to the code generator will cause
a version bump in all of them, but this should not be relied upon.
"""
references = ["smithy-rs#1540"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "jdisanti"
+6 −6
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ This is the README Handlebars template for `aws-sdk-rust`.
It gets instantiated and copied into the build artifacts by the `aws:sdk:assemble` build target.

Available template arguments:
- `{{sdk_version}}`: the SDK version number (just the number, no `v` prefix)
- `{{sdk_version_<crate_name_in_snake_case>}}` (e.g., `{{sdk_version_aws_config}}` for the `aws-config` crate): the version number of the given crate (just the number, no `v` prefix)
- `{{msrv}}`: The MSRV Rust compiler version (just the number, no `v` prefix)
--}}
<!--
@@ -12,9 +12,9 @@ This README file is auto-generated by the build system in awslabs/smithy-rs.
To update it, edit the `aws/SDK_README.md.hb` Handlebars template in that repository.
-->

# The AWS SDK for Rust [![Docs](https://img.shields.io/badge/docs-v{{sdk_version}}-blue)](https://awslabs.github.io/aws-sdk-rust/) ![MSRV](https://img.shields.io/badge/msrv-{{msrv}}-red) [![Usage Guide](https://img.shields.io/badge/Developer_Guide-blue)](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html)
# The AWS SDK for Rust [![Docs](https://img.shields.io/badge/docs-blue)](https://awslabs.github.io/aws-sdk-rust/) ![MSRV](https://img.shields.io/badge/msrv-{{msrv}}-red) [![Usage Guide](https://img.shields.io/badge/Developer_Guide-blue)](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html)

This repo contains the new AWS SDK for Rust (the SDK) and its [public roadmap](https://github.com/awslabs/aws-sdk-rust/projects/1).
This repo contains the new AWS SDK for Rust (the SDK) and its [public roadmap](https://github.com/orgs/awslabs/projects/50/views/1).

**Please Note: The SDK is currently released as a developer preview and is intended strictly for feedback purposes only. Do not use this SDK for production workloads.**

@@ -22,7 +22,7 @@ The SDK is code generated from [Smithy models](https://awslabs.github.io/smithy/

## Getting Started with the SDK

> Examples are availble for many services and operations, check out the [examples folder](./examples).
> Examples are available for many services and operations, check out the [examples folder](./examples).

> For a step-by-step guide including several advanced use cases, check out the [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html).

@@ -33,8 +33,8 @@ The SDK provides one crate per AWS service. You must add [Tokio](https://crates.

    ```toml
    [dependencies]
    aws-config = "{{sdk_version}}"
    aws-sdk-dynamodb = "{{sdk_version}}"
    aws-config = "{{sdk_version_aws_config}}"
    aws-sdk-dynamodb = "{{sdk_version_aws_sdk_dynamodb}}"
    tokio = { version = "1", features = ["full"] }
    ```

+3 −3
Original line number Diff line number Diff line
@@ -31,13 +31,13 @@ dependencies {
    testImplementation("io.kotest:kotest-assertions-core-jvm:$kotestVersion")
}

val generateAwsSdkVersion by tasks.registering {
val generateAwsRuntimeCrateVersion by tasks.registering {
    // generate the version of the runtime to use as a resource.
    // this keeps us from having to manually change version numbers in multiple places
    val resourcesDir = "$buildDir/resources/main/software/amazon/smithy/rustsdk"
    val versionFile = file("$resourcesDir/sdk-crate-version.txt")
    outputs.file(versionFile)
    val crateVersion = project.properties["aws.sdk.version"]?.toString()!!
    val crateVersion = project.properties["smithy.rs.runtime.crate.version"]?.toString()!!
    inputs.property("crateVersion", crateVersion)
    sourceSets.main.get().output.dir(resourcesDir)
    doLast {
@@ -47,7 +47,7 @@ val generateAwsSdkVersion by tasks.registering {

tasks.compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
    dependsOn(generateAwsSdkVersion)
    dependsOn(generateAwsRuntimeCrateVersion)
}

tasks.compileTestKotlin {
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ class AwsReadmeDecorator : RustCodegenDecorator<ClientCodegenContext> {
        mapOf("package" to mapOf("readme" to "README.md"))

    override fun extras(codegenContext: ClientCodegenContext, rustCrate: RustCrate) {
        val awsConfigVersion = SdkSettings.from(codegenContext.settings).awsConfigVersion
        rustCrate.withFile("README.md") { writer ->
            val description = normalizeDescription(
                codegenContext.moduleName,
@@ -62,7 +63,7 @@ class AwsReadmeDecorator : RustCodegenDecorator<ClientCodegenContext> {

                    ```toml
                    [dependencies]
                    aws-config = "${codegenContext.settings.moduleVersion}"
                    aws-config = "$awsConfigVersion"
                    $moduleName = "${codegenContext.settings.moduleVersion}"
                    tokio = { version = "1", features = ["full"] }
                    ```
Loading