Skip to content

Commit

Permalink
chore(v7): remove releaser configuration (#299)
Browse files Browse the repository at this point in the history
This commit removes the `.ldrelease` directory. The release process is
replaced with `release-please` Github Action.
  • Loading branch information
cwaldren-ld authored Feb 12, 2024
1 parent 9ea48b5 commit 867be2c
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 148 deletions.
7 changes: 0 additions & 7 deletions .ldrelease/build.sh

This file was deleted.

53 changes: 0 additions & 53 deletions .ldrelease/config.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .ldrelease/prepare.sh

This file was deleted.

12 changes: 0 additions & 12 deletions .ldrelease/publish-dry-run.sh

This file was deleted.

6 changes: 0 additions & 6 deletions .ldrelease/publish.sh

This file was deleted.

27 changes: 0 additions & 27 deletions .ldrelease/run-publish-target.sh

This file was deleted.

6 changes: 0 additions & 6 deletions .ldrelease/secrets.properties

This file was deleted.

8 changes: 0 additions & 8 deletions .ldrelease/update-version.sh

This file was deleted.

2 changes: 0 additions & 2 deletions Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# This is the Dockerfile used for release (published to dockerhub by goreleaser)

# See .ldrelease/config.yml for an explanation of the build/release process.

FROM alpine:3.19.0
# See "Runtime platform versions" in CONTRIBUTING.md

Expand Down
9 changes: 2 additions & 7 deletions scripts/update-go-release-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fi

cd $(dirname $0)/..

ldrelease_config_file=.ldrelease/config.yml
github_config_file=.github/variables/go-versions.env
dockerfile_for_tests=Dockerfile

Expand All @@ -24,17 +23,13 @@ function ensure_file_was_changed() {
if (( $(diff ${filename} ${filename}.tmp | grep '^>' | wc -l) < 1 )); then
echo "failed to update Go version in ${filename}; sed expression did not match any lines or matched more than one line"
diff ${filename} ${filename}.tmp || true
for f in ${ldrelease_config_file} ${github_config_file} ${dockerfile_for_tests}; do
for f in ${github_config_file} ${dockerfile_for_tests}; do
rm -r ${f}.tmp
done
exit 1
fi
}

sed <${ldrelease_config_file} >${ldrelease_config_file}.tmp \
-e "/image:/s#cimg/go:[^ ]*#cimg/go:${LATEST_VERSION}#"
ensure_file_was_changed ${ldrelease_config_file}

sed <${github_config_file} >${github_config_file}.tmp \
-e "s#latest=[^ ]*#latest=${LATEST_VERSION}#g" \
-e "s#penultimate=[^ ]*#penultimate=${PENULTIMATE_VERSION}#g"
Expand All @@ -44,7 +39,7 @@ sed <${dockerfile_for_tests} >${dockerfile_for_tests}.tmp \
-e "s#FROM *golang:[^-]*#FROM golang:${LATEST_VERSION}#"
ensure_file_was_changed ${dockerfile_for_tests}

for f in ${ldrelease_config_file} ${github_config_file} ${dockerfile_for_tests}; do
for f in ${github_config_file} ${dockerfile_for_tests}; do
mv ${f}.tmp ${f}
echo "updated ${f}"
done
Expand Down
16 changes: 2 additions & 14 deletions scripts/verify-release-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
# verify-release-versions.sh (no parameters)
# This script checks all of the configuration files where a Go version and/or Alpine version is
# mentioned in the context of producing releases, and makes sure they are consistent with each other.
# Unfortunately it's not possible to have these be sourced from just one file, because the CircleCI
# configuration and the .ldrelease configuration require Docker image names to be hard-coded in their
# respective config files.

set -e

cd $(dirname $0)/..

ldrelease_config_file=.ldrelease/config.yml
github_config_file=.github/variables/go-versions.env
dockerfile_for_tests=Dockerfile
dockerfile_for_releases=Dockerfile.goreleaser
Expand All @@ -21,12 +17,6 @@ function fail_for_file() {
exit 1
}

LDRELEASE_GO_VERSION=$(sed <${ldrelease_config_file} -n 's#.*image: *cimg/go:\([0-9.]*\).*#\1#p')
if [ -z "${LDRELEASE_GO_VERSION}" ]; then
fail_for_file Go ${ldrelease_config_file}
fi
echo "${ldrelease_config_file} (for building releases) is using Go ${LDRELEASE_GO_VERSION}"

GITHUB_GO_VERSION=$(sed <${github_config_file} -n 's/^latest=\(.*\)$/\1/p')
if [ -z "${GITHUB_GO_VERSION}" ]; then
fail_for_file Go ${github_config_file}
Expand All @@ -39,8 +29,7 @@ if [ -z "${DOCKERFILE_TESTS_GO_VERSION}" ]; then
fi
echo "${dockerfile_for_tests} (for images in CI tests) is using Go ${DOCKERFILE_TESTS_GO_VERSION}"

if [[ "${GITHUB_GO_VERSION}" != "${LDRELEASE_GO_VERSION}" || \
"${DOCKERFILE_TESTS_GO_VERSION}" != "${LDRELEASE_GO_VERSION}" ]]; then
if [[ "${GITHUB_GO_VERSION}" != "${DOCKERFILE_TESTS_GO_VERSION}" ]]; then
echo; echo "Go versions are out of sync!"
exit 1
fi
Expand Down Expand Up @@ -77,9 +66,8 @@ echo "Alpine versions are in sync"

echo "Checking availability of Docker images..."
for docker_image in \
"cimg/go:${LDRELEASE_GO_VERSION}" \
"alpine:${DOCKERFILE_RELEASES_ALPINE_VERSION}" \
"golang:${LDRELEASE_GO_VERSION}-alpine${DOCKERFILE_TESTS_ALPINE_MINOR_VERSION}"
"golang:${GITHUB_GO_VERSION}-alpine${DOCKERFILE_TESTS_ALPINE_MINOR_VERSION}"
do
echo -n " ${docker_image}... "
docker pull ${docker_image} >/dev/null 2>/dev/null || { echo; echo "not available!"; exit 1; }
Expand Down

0 comments on commit 867be2c

Please sign in to comment.