buildinfy 0.2.1

Easy access to GitLab/GitHub/Gitea CI/CD variables for automatic versioning
Documentation

buildinfy

Want easy access to CI variables such as revision, pipeline number, CI job name, target platform, and Sentry DSN? This crate provide just that for GitLab, Gitea, and GitHub.

// returns branch name: `main`, `stable`...
fn build_reference() -> Option<&'static str>;
// returns CI run number: e.g. `123`.
build_pipeline_id_per_project() -> Option<&'static str>;
// returns CI job name: e.g. `package-debian-amd64`.
fn build_job_name() -> Option<&'static str>;
// returns owner and repository name: e.g. bitpowder/indigo-ng.
fn build_project() -> Option<&'static str>;
// returns the `SENTRY_DSN` variable, useful to configure crash reporting in certain builds.
fn build_sentry_dsn() -> Option<&'static str>;
// returns platform: linux, freebsd, win, mac, unix, other (useful for auto updating URLs)
fn build_target() -> &'static str;