Skip to content

Commit

Permalink
🐛 [Golang] fix goreleaser command deprecation (#106)
Browse files Browse the repository at this point in the history
<!--
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).
  • Loading branch information
acabarbaye authored Jan 10, 2025
1 parent 63cdb78 commit a5ecba4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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)

0 comments on commit a5ecba4

Please sign in to comment.