Skip to content
Open
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
10 changes: 0 additions & 10 deletions .github/workflows/tools-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,3 @@ jobs:
out/envtest-*.tar.gz
out/envtest-*.tar.gz.sha512
fail_on_unmatched_files: true
- name: Create Pull Request
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # tag=v7.0.8
with:
commit-message: Promote envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}
title: ":seedling: Promotion of envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}"
body: |
This PR promotes the envtest release for Kubernetes ${{ env.KUBERNETES_VERSION }}.
branch: promote-envtest-${{ env.KUBERNETES_VERSION }}
add-paths: |
envtest-releases.yaml
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ release-envtest: clean-release ## Build the envtest binaries by operating system
OS=darwin ARCH=amd64 $(MAKE) release-envtest-docker-build
OS=darwin ARCH=arm64 $(MAKE) release-envtest-docker-build
OS=windows ARCH=amd64 $(MAKE) release-envtest-docker-build
./hack/envtest/update-releases.sh

.PHONY: release-envtest-docker-build
release-envtest-docker-build: $(RELEASE_DIR) ## Build the envtest binaries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ fi
# Add the newly built Kubernetes version to the releases.yaml file with yq as an object key under releases
yq eval ".releases += {\"${KUBERNETES_VERSION}\": {}}" -i "${ROOT}"/envtest-releases.yaml

for file in "${ROOT}"/out/*.tar.gz; do
file_name=$(basename "${file}")
file_hash=$(awk '{ print $1 }' < "${file}.sha512")
self_link=https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-${KUBERNETES_VERSION}/${file_name}
sha_files=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/kubernetes-sigs/controller-tools/releases/tags/envtest-${KUBERNETES_VERSION} |
jq '.assets[] | select(.name | contains("sha512")) | .name' -r)

for sha_file in ${sha_files}; do
file_name=${sha_file%".sha512"}
file_hash=$(curl -L https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-${KUBERNETES_VERSION}/${sha_file} | awk '{ print $1 }')
self_link=https://github.com/kubernetes-sigs/controller-tools/releases/download/envtest-${KUBERNETES_VERSION}/${file_name}
yq eval \
".releases[\"${KUBERNETES_VERSION}\"] += {\"${file_name}\": {\"hash\": \"${file_hash}\", \"selfLink\": \"${self_link}\"}}" \
-i "${ROOT}"/envtest-releases.yaml
Expand Down