version_bump/plugins/hex

The Hex / Gleam publish plugin (plugin name “hex”).

The Gleam analogue of @semantic-release/npm. It publishes the package to the Hex package repository with gleam publish. Two things differ from npm: the version lives in gleam.toml (not package.json), and Hex has no dist-tag / channel concept, so add_channel is intentionally NOT implemented (a prerelease is published as an ordinary semver prerelease and Hex surfaces it as such).

set_version and package_name are PURE string functions, exported so the version rewrite and URL construction can be unit-tested without any IO.

Values

pub fn package_name(
  gleam_toml: String,
) -> Result(String, error.ReleaseError)

Read the package name from a gleam.toml document. PURE.

pub fn plugin() -> plugin.Plugin

Build the Hex plugin: implements verify_conditions, prepare, and publish. There is deliberately no add_channel — Hex has no dist-tags.

pub fn set_version(
  gleam_toml: String,
  version: String,
) -> Result(String, error.ReleaseError)

Replace the top-level version = "..." value in a gleam.toml document with version, leaving the rest of the file intact. PURE.

Search Document