Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Golang] fix goreleaser command deprecation #106

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion continuous_delivery_scripts/plugins/golang.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}",
]
Expand All @@ -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"]

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions news/20250110123102.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:gear: `[Golang]` Install [`syft`](https://github.com/anchore/syft) since it is a dependency to `goreleaser`
1 change: 1 addition & 0 deletions news/20250110123255.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:bug: `[Golang]` fix `goreleaser` [command deprecation](https://goreleaser.com/deprecations/#-rm-dist)
Loading