diff --git a/continuous_delivery_scripts/plugins/golang.py b/continuous_delivery_scripts/plugins/golang.py index fe4a869..25c2551 100644 --- a/continuous_delivery_scripts/plugins/golang.py +++ b/continuous_delivery_scripts/plugins/golang.py @@ -41,7 +41,7 @@ def _generate_goreleaser_release_command_list(changelog: Path) -> List[str]: return [ "goreleaser", "release", - "--rm-dist", + "--clean", "--release-notes", f"{str(changelog)}", ] @@ -62,6 +62,10 @@ def _install_golds_command_list() -> List[str]: ] # FIXME change version to latest when https://github.com/go101/golds/issues/26 is fixed +def _install_syft_command_list() -> List[str]: + return ["go", "install", "github.com/anchore/syft/cmd/syft@latest"] + + def _install_goreleaser_command_list() -> List[str]: return ["go", "install", "github.com/goreleaser/goreleaser@latest"] @@ -87,6 +91,7 @@ def _call_goreleaser_check(version: str) -> None: logger.info("Installing GoReleaser if missing.") env = os.environ env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE + check_call(_install_syft_command_list(), env=env) check_call(_install_goreleaser_command_list(), env=env) logger.info("Checking GoReleaser configuration.") env[ENVVAR_GORELEASER_CUSTOMISED_TAG] = version @@ -175,6 +180,7 @@ def _call_goreleaser_release(self, version: str) -> None: logger.info("Installing GoReleaser if missing.") env = os.environ env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE + check_call(_install_syft_command_list(), env=env) check_call(_install_goreleaser_command_list(), env=env) tag = self.get_version_tag(version) # The tag of the release must be retrieved diff --git a/news/20250110123102.bugfix b/news/20250110123102.bugfix new file mode 100644 index 0000000..e4375a3 --- /dev/null +++ b/news/20250110123102.bugfix @@ -0,0 +1 @@ +:gear: `[Golang]` Install [`syft`](https://github.com/anchore/syft) since it is a dependency to `goreleaser` diff --git a/news/20250110123255.bugfix b/news/20250110123255.bugfix new file mode 100644 index 0000000..796937f --- /dev/null +++ b/news/20250110123255.bugfix @@ -0,0 +1 @@ +:bug: `[Golang]` fix `goreleaser` [command deprecation](https://goreleaser.com/deprecations/#-rm-dist)