Skip to content

Generated gRPC pbs in Rust for interacting with IAM runtimes

License

Notifications You must be signed in to change notification settings

metal-toolbox/iam-runtime-rs

Repository files navigation

There are 2 crates in this repo: builder and iam-runtime.

The builder is there to generate the protobuf code. It is not published. The generated code ends up in iam-runtime which is published as the iam-runtime-rs crate.

We separate it like this so that iam-runtime-rs does not need to be responsible for building itself, meaning crates which depend on iam-runtime-rs do not need to have protoc installed.

Prepare a new crate version

There is a Github Action which will run once a week to automatically bump the version if there is a new version of iam-runtime.

If you would like to trigger a bump ahead of schedule, navigate to the Action tab in Github. Select the Bump version workflow. On the right-hand side, select Run workflow.The action will check whether a new version exists on iam-runtim, fetch the protos for that version, build the code and open a PR.

When the action completes, review and merge the PR. After that you can trigger the Publish workflow.

Publish a new crate

After merging, navigate to the Action tab in Github. Select the Publish workflow. On the right-hand side, select Run workflow. This will publish a new crate. Verify that a new one exists on crates.io after the task has run.

Manual alternative

If either of the workflows do not work, here are the manual steps:

  1. Update the version of the iam-runtime in iam_runtime_version.txt:

    echo -e "v0.0.0" > iam_runtime_version.txt
    
  2. Update the version of the crate in iam-runtime/Cargo.toml

  3. Run make build This will:

    • Fetch the proto definitions from iam-runtime, put them in ./builder/proto.
    • Bump the version number in Cargo.toml.
    • Generate the protobuf code.
    • Check that everything builds.
  4. Commit and push your changes.

  5. Get an API key from crates.io. If you are not a member of an owning team you will not be able to do the next steps.

  6. Login locally:

    cargo login
    # paste in your key when prompted
  7. Run make publish. This will:

    • Do a dry run of the crates.io publish
    • Publish the actual crate.
  8. Check the crate has been updated on crates.io

TODO

  • Automate the PR workflow whenever a new iam-runtime version is released
  • Remove the manual step of publishing

About

Generated gRPC pbs in Rust for interacting with IAM runtimes

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published