Artifacts & cargo-dist

oranda has first-class support for handling releases, including ones generated by cargo-dist. It can even detect the user's platform and recommend the best installer/archive to use!

Artifact settings are managed in the artifacts key in your oranda config. This is what an example config looks like:

{
  "components": {
    "artifacts": {
      "package_managers": {
        "preferred": {
          "npm": "npm install @axodotdev/oranda --save-dev",
          "crates.io": "cargo install oranda --locked --profile=dist",
        },
        "additional": {
          "npx": "npx @axodotdev/oranda",
          "binstall": "cargo binstall oranda"
        }
      }
    }
  }
}

Enabling cargo-dist

oranda will automatically attempt to find a cargo-dist config in your Cargo.toml. If you want to force disable this, set components.artifacts.cargo_dist to false. Once oranda determines that cargo-dist support should be enabled, the following will happen:

  • oranda will attempt to find GitHub releases generated by cargo-dist
  • A new "Install" page will be generated, containing all artifacts and installers for the latest version
  • A section to quickly install the latest release for the user's current platform will be added to the homepage

Enabling arbitrary GitHub release support

Even if you don't have cargo-dist set up, oranda can attempt to glean information about your supported targets and OSes from your GitHub release artifacts. It will attempt to do this if it can find any releases associated with your repository. It does this by trying to see if it can recognize any known target triples from your filenames, so for example, it will recognize mytool-aarch64-apple-darwin.tar.gz. If you would like to completely disable this, set components.artifacts to false (we may offer a more fine-grained setting for this in the future).

Enabling matching a release to a specific package

If you have multiple packages being produced by a workspace and need to match a release to a specific package, you can do so by setting components.artifacts.match_package_names to true. Upon enabling, while working to determine the latest release oranda will check if the release tag contains the name of the project being generated. If no match is found that particular release will be skipped.

Adding package manager installation instructions

You can add custom installation instructions for package managers or package manager-esque methods using the components.artifacts.package_managers key. These are broken up into two sections:

  • components.artifacts.package_managers.preferred - methods that you want to be recommended on the front page install widget
  • components.artifacts.package_managers.additional - methods that should only show up on the dedicated "install" page

All package manager entries are currently treated as "cross-platform", meaning they'll show up in the install widget for any platform you support. We're aware of this limitation, and will likely expand support for this in the future.