rlsbl v0.40.1 /rlsbl.targets.go
On this page

Go release target using a VERSION file as source of truth, with GoReleaser integration, npm wrapper packaging, asset builds, and dev-install support.

#rlsbl.targets.go

#rlsbl.targets.go

Go release target using a VERSION file as source of truth, with GoReleaser integration for binaries and module proxy notification for libs.

#_go_archive_fn

python
def _go_archive_fn(spec, name)

Return (asset_pattern, extract_cmd, binary_name) for a Go/goreleaser build.

#GoTarget

Release target for Go projects (go.mod + VERSION file).

#name

python
def name(self)

#detect

python
def detect(self, dir_path)

#read_name

python
def read_name(self, dir_path)

Read the last segment of the module path from go.mod.

#read_metadata

python
def read_metadata(self, dir_path)

Go modules have no license/description in go.mod.

#_read_module_path

python
def _read_module_path(self, dir_path)

Extract the module path from go.mod, or empty string if unavailable.

#_is_library

python
def _is_library(self, dir_path)

Return True if the project has no package main in root .go files.

#_has_root_main

python
def _has_root_main(self, dir_path)

Return True if there's a main.go at the project root with package main.

#_has_version_var

python
def _has_version_var(self, dir_path)

Return True if any root-level .go file declares a Version variable.

#_has_cmd_main

python
def _has_cmd_main(self, dir_path)

Return True if there's a single cmd/*/main.go with package main.

Returns False if there are multiple cmd/ subdirectories (multi-binary repos where cmd/ is the correct layout) or no cmd/ entries at all.

#build_assets

python
def build_assets(self, dir_path, version, dist_dir)

Build Go binary for the host platform into dist_dir.

#publish

python
def publish(self, dir_path, version)

Notify the Go module proxy so the new version is immediately available.

#read_version

python
def read_version(self, dir_path)

Read version from the VERSION file.

#write_version

python
def write_version(self, dir_path, version)

Write the new version to the VERSION file.

Returns a list of relative file paths that were modified.

#version_file

python
def version_file(self)

#tag_format

python
def tag_format(self, version)

#monorepo_tag_format

python
def monorepo_tag_format(self, name, version, path=None)

#monorepo_tag_glob

python
def monorepo_tag_glob(self, name, path=None)

#template_dir

python
def template_dir(self)

#template_vars

python
def template_vars(self, dir_path)

Extract template variables from go.mod and .rlsbl/config.json.

#template_mappings

python
def template_mappings(self)

#shared_template_mappings

python
def shared_template_mappings(self)

#check_project_exists

python
def check_project_exists(self, dir_path)

#get_project_init_hint

python
def get_project_init_hint(self)

#dev_install_command

python
def dev_install_command(self, project_dir)