Skip to content

Instantly share code, notes, and snippets.

@Xiphoseer
Last active December 17, 2020 00:22
Show Gist options
  • Save Xiphoseer/879e581a005f194c6acaa43fc1080b66 to your computer and use it in GitHub Desktop.
Save Xiphoseer/879e581a005f194c6acaa43fc1080b66 to your computer and use it in GitHub Desktop.
GitHub Crate Repositories

Concept

  1. Create a github repo https://github.com/YOUR_USER_OR_ORG/crates
  2. Set the config.json to something like:
{
    "dl": "https://github.com/YOUR_USER_OR_ORG/{crate}/releases/download/v{version}/package.crate"
}
  1. Create a CLI tool / cargo subcommand that
    1. uses github_auth to log in and
    2. creates a tag in the current git repo that corresponds to the crate version
    3. publishes a new github release for that tag
    4. runs cargo package
    5. attaches the the package.crate to that release
    6. adds a new release json to the crates repo
  2. Profit!

Restrictions

  • Crate names need to match repository names!
  • Need some way to get the release description
  • Should work in CI / CD as well

Additional ideas

  • Two modes:
    1. monorepo with fixed repo name and {crate}.crate release attachment
    2. user-wide with {crate} repo name and package.crate release attachment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment