Skip to content

Commit

Permalink
update golang ci lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecutalo committed Dec 15, 2023
1 parent 126661c commit 58941db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
id: setup-go
with:
go-version: 1.21.x
Expand Down
20 changes: 13 additions & 7 deletions tools/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ BUILD_ROOT="${REPO_ROOT}/build"
BUILD_BIN="${BUILD_ROOT}/bin"

NAME=golangci-lint
RELEASE=v1.53.2
OSX_RELEASE_256=a4e83f5bfe52f42134c9783aa68ba31104c36e2ad4c221a3c77510dda66ae81c
LINUX_RELEASE_256=2298f73b9bc03b88b91fee06c5d519fc7f9d7f328e2c388615bbd7e85a9d6cae
RELEASE=v1.53.3
OSX_RELEASE_256=e6fe5df023c35482cf9858eeb0a14aeecea58e64549be9084268b4a1fb632ece
LINUX_RELEASE_256=4f62007ca96372ccba54760e2ed39c2446b40ec24d9a90c21aad9f2fdf6cf0da

ARCH=amd64

Expand All @@ -28,9 +28,15 @@ ensure_binary() {
mkdir -p "${BUILD_BIN}"

case "${OSTYPE}" in
"darwin"*) os_type="darwin"; sum="${OSX_RELEASE_256}" ;;
"linux"*) os_type="linux"; sum="${LINUX_RELEASE_256}" ;;
*) echo "error: Unsupported OS '${OSTYPE}' for shellcheck install, please install manually" && exit 1 ;;
"darwin"*)
os_type="darwin"
sum="${OSX_RELEASE_256}"
;;
"linux"*)
os_type="linux"
sum="${LINUX_RELEASE_256}"
;;
*) echo "error: Unsupported OS '${OSTYPE}' for shellcheck install, please install manually" && exit 1 ;;
esac

release_archive="/tmp/${NAME}-${RELEASE}.tar.gz"
Expand All @@ -44,7 +50,7 @@ ensure_binary() {
tar -xzf "${release_archive}" --strip=1 -C "${release_tmp_dir}"

if [[ ! -f "${RELEASE_BINARY}" ]]; then
find "${BUILD_BIN}" -maxdepth 0 -regex '.*/'${NAME}'-[A-Za-z0-9\.]+$' -exec rm {} \; # cleanup older versions
find "${BUILD_BIN}" -maxdepth 0 -regex '.*/'${NAME}'-[A-Za-z0-9\.]+$' -exec rm {} \; # cleanup older versions
mv "${release_tmp_dir}/${NAME}" "${RELEASE_BINARY}"
fi

Expand Down

0 comments on commit 58941db

Please sign in to comment.