Skip to content

Commit a5ecba4

Browse files
authored
🐛 [Golang] fix goreleaser command deprecation (#106)
<!-- Copyright (C) 2020-2025 Arm Limited or its affiliates and Contributors. All rights reserved. SPDX-License-Identifier: Apache-2.0 --> ### Description --rm-dist is now deprecated ### Test Coverage <!-- Please put an `x` in the correct box e.g. `[x]` to indicate the testing coverage of this change. --> - [ ] This change is covered by existing or additional automated tests. - [x] Manual testing has been performed (and evidence provided) as automated testing was not feasible. - [ ] Additional tests are not required for this change (e.g. documentation update).
1 parent 63cdb78 commit a5ecba4

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

continuous_delivery_scripts/plugins/golang.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def _generate_goreleaser_release_command_list(changelog: Path) -> List[str]:
4141
return [
4242
"goreleaser",
4343
"release",
44-
"--rm-dist",
44+
"--clean",
4545
"--release-notes",
4646
f"{str(changelog)}",
4747
]
@@ -62,6 +62,10 @@ def _install_golds_command_list() -> List[str]:
6262
] # FIXME change version to latest when https://github.com/go101/golds/issues/26 is fixed
6363

6464

65+
def _install_syft_command_list() -> List[str]:
66+
return ["go", "install", "github.com/anchore/syft/cmd/syft@latest"]
67+
68+
6569
def _install_goreleaser_command_list() -> List[str]:
6670
return ["go", "install", "github.com/goreleaser/goreleaser@latest"]
6771

@@ -87,6 +91,7 @@ def _call_goreleaser_check(version: str) -> None:
8791
logger.info("Installing GoReleaser if missing.")
8892
env = os.environ
8993
env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE
94+
check_call(_install_syft_command_list(), env=env)
9095
check_call(_install_goreleaser_command_list(), env=env)
9196
logger.info("Checking GoReleaser configuration.")
9297
env[ENVVAR_GORELEASER_CUSTOMISED_TAG] = version
@@ -175,6 +180,7 @@ def _call_goreleaser_release(self, version: str) -> None:
175180
logger.info("Installing GoReleaser if missing.")
176181
env = os.environ
177182
env[ENVVAR_GO_MOD] = GO_MOD_ON_VALUE
183+
check_call(_install_syft_command_list(), env=env)
178184
check_call(_install_goreleaser_command_list(), env=env)
179185
tag = self.get_version_tag(version)
180186
# The tag of the release must be retrieved

news/20250110123102.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:gear: `[Golang]` Install [`syft`](https://github.com/anchore/syft) since it is a dependency to `goreleaser`

news/20250110123255.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:bug: `[Golang]` fix `goreleaser` [command deprecation](https://goreleaser.com/deprecations/#-rm-dist)

0 commit comments

Comments
 (0)