Skip to content

publish codegen artifacts to maven central#4218

Merged
aajtodd merged 25 commits intomainfrom
publish-codegen
Sep 9, 2025
Merged

publish codegen artifacts to maven central#4218
aajtodd merged 25 commits intomainfrom
publish-codegen

Conversation

@aajtodd
Copy link
Contributor

@aajtodd aajtodd commented Jul 16, 2025

Motivation and Context

Publish codegen artifacts to Maven Central so users can generate Rust clients + servers without cloning smithy-rs and patching our build files.

Description

  • Move dependency management to version catalogs
  • Move common kotlin and publishing configuration to conventional gradle plugins removing duplication and making a single place to modify this config
  • Add jreleaser and configure it for releasing to maven central (this seems to be where everyone is landing, smithy team uses it already and Kotlin SDK is migrating)
  • Introduce tasks for checking if a codegen version exists and if gradle.properties has been updated if any codegen project has changed
    • On release it checks if we need to do a publish
    • On PR it checks if we modified codegen projects that we have also bumped the version
  • Rename several modules
    • codegen-server/python -> codegen-server/codegen-server-python
    • codegen-server/typescript -> codegen-server/codegen-server-typescript
    • aws/sdk-codegen -> aws/codegen-aws-sdk

TODO

  • Need to decide on artifact names. We can probably live with most of them but the python/typescript artifacts don't indicate anything server specific and the sdk-codegen one doesn't indicate "AWS SDK" specific. Generally we don't publish the AWS SDK specific codegen but we tied up a lot of the "AWS specific" stuff like sigv in that module so seems like we might need to publish it as well for it to be of use. Open to discussion though.
  • Need to work with @drganjoo on internal testing, in particular need to figure out internal patch file updates needed to land this and versioning scheme
  • Need to finish configuring secrets
  • Publish GPG keys, for some reason this is still not working I may need to switch machines to try it on
  • Complete additional dry run release testing
  • Test artifacts and document how to use them in a build script to generate code for generic smithy models

Testing

Checklist

  • For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "client," "server," or both in the applies_to key.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aajtodd aajtodd force-pushed the publish-codegen branch 2 times, most recently from d12b2b6 to 3d75fe4 Compare July 22, 2025 12:00
@aajtodd aajtodd marked this pull request as ready for review July 22, 2025 17:26
@aajtodd aajtodd requested review from a team as code owners July 22, 2025 17:26
Copy link
Contributor

@landonxjames landonxjames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, couple of questions about the python/typescript bindings for the server, but those aren't blockers

id("smithy-rs.publishing-conventions")
}

description = "Generates Rust/Python server-side code from Smithy models"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we discussed not publishing the Typescript bindings, but I'm not terribly convinced that we should publish the Python bindings either. I guess people are using them? But my understanding is that support is pretty minimal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably up to @drganjoo, I'm ok either way as these are all pre-GA versions for codegen with no backwards compat or stability guarantees.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Python is being used.

@aajtodd
Copy link
Contributor Author

aajtodd commented Aug 25, 2025

The generate diff action is failing. I think this is due to relocating some of the codegen modules and the base version we are merging into has a different path from where we expect it to live. I created a PR to test the workflow from this branch as the base and the diff step succeeds.

@aajtodd aajtodd force-pushed the publish-codegen branch 2 times, most recently from 5c162bd to cf5f52f Compare September 2, 2025 14:20
Copy link
Contributor

@ysaito1001 ysaito1001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome job on renaming & cleanup, also!

@aajtodd aajtodd merged commit 2016a67 into main Sep 9, 2025
48 of 49 checks passed
@aajtodd aajtodd deleted the publish-codegen branch September 9, 2025 19:02
aajtodd added a commit that referenced this pull request Sep 10, 2025
## Description
<!--- Describe your changes in detail -->

#4218 broke the docker
image build in a subtle way which is that we added Gradle build logic to
`buildSrc` that is used in the root `build.gradle.kts` file. This wasn't
found in PR:4218 because the docker build does a sparse checkout of the
`main` branch which did not have the new logic/issue and thus was not
triggered until after merging.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
Local + CI build succeeds

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants