package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.kit/B0_release/index.html
Module B0_release
Source
Source software release helpers.
Metadata
tag
tags releasable entities.
VCS repos and release versions
vcs_repo_of_pack pack
is Ok (scope_dir, repo)
if pack
has a VCS controlled scope directory.
val vcs_repo_version_of_pack :
?commit_ish:B0_vcs_repo.commit_ish ->
B0_pack.t ->
(string, string) result
vcs_repo_version_of_pack p
looks for a VCS in the scope directory of p
and gets its latest annotated tag reachable from commit_ish
(defaults to "HEAD"
) and drops an initial 'v'
or 'V'
.
TODO. add a meta key to prevent v drop.
Source archives
Extension and basename
archive_ext
is the file extension of the source release's archive. Defaults to ".tbz"
, this is used for creating archives so do not steer away from the extensions mentioned in B0_tar.compress
.
archive_name
is the basename of the source release's archive.
src_archive_name_of_meta m
is the value or src_archive_name
or the pack's basename if absent, unless this is default
in which case the basename of the pack's scope is taken.
URL
src_archive_url
is an URL pattern that specifies a source release on the WWW. The following variables are to be subsituted %%ARCHIVE_NAME%%
, %%ARCHIVE_EXT%%
, %%VERSION%%
, %%VERSION_NUM%%
, see src_archive_url_of_pack
for more details.
src_url_of_meta ~version p
derives a source URL for the pack p
. This looks up src_archive_url
p
and substitute the variables as follows:
%%ARCHIVE_NAME%%
with the value ofsrc_archive_name_of_pack
.%%ARCHIVE_EXT%%
with the value ofsrc_archive_ext
.%%VERSION%%
with the value ofversion
%%VERSION_NUM%%
with the value ofversion
with an initialv
orV
chopped.
If src_archive_url
is absent, let %%HOMEPAGE%%
be the value of B0_meta.homepage
and %%REPO%%
be the value of B0_meta.repo
without the final .git
and initial git+
Then:
If the hostname of
B0_meta.homepage
is github the following URL pattern is used:%%REPO%%/releases/download/%%VERSION%%/\ %%ARCHIVE_NAME%%-%%VERSION_NUM%%%%ARCHIVE_EXT%%
Otherwise the following URL pattern is used:
%%HOMEPAGE%%/releases/\ %%ARCHIVE_NAME%%-%%VERSION_NUM%%%%ARCHIVE_EXT%%
Archive file creation
val src_archive_for_pack :
repo:B0_vcs_repo.t ->
checkout_dir:B0_std.Fpath.t ->
keep_checkout_dir:bool ->
commit_ish:B0_vcs_repo.commit_ish ->
B0_pack.t ->
(string * B0_std.Fpath.t * string, string) result
for_pack pack
is a directory basename and corresponding uncompresed tar archive for pack pack
. The first string indicates the version string.
checkout_dir
indicates the directory in which the VCS is checkout, and release massaging occurs. WARNING. this directory is deleted before starting. If keep_checkout_dir
is false
it is destroyed before the function returns.
Changes file
changes_file
is a metadata key to specify a changes file value. Relative paths are relative to the scope directory of the definition. Defaults to Fpath.v CHANGES.md
.
find_changes_file_of_pack p
looks for the changes_file
of p
in the scope directory of p
and returns its absolute path if it exists.
get_changes_file_of_pack pack
looks for the changes_file
of pack
and makes sure it exists or errors otherwise.
changes_latest_of_file f
extracts the latest release notes as the first markdown section of file f
.
changes_latest_version title
extracts the first token of title
(typically extracted with changes_latest_of_file
) as a version tag.