Skip to content

Commit

Permalink
Rename script to reflect new use case. Update workflow to match
Browse files Browse the repository at this point in the history
Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano committed Jan 14, 2025
1 parent 58be8d0 commit f7e42b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/release_update_readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
export COMPONENT="$(echo "${TAG_NAME}" | cut -d'/' -f2)"
export VERSION="$(echo "${TAG_NAME}" | cut -d'/' -f3)"
./ci/update_readme_with_latest_release.sh "${COMPONENT}" "${VERSION}" "${URL}"
./ci/update_files_with_release_versions.sh "${COMPONENT}" "${VERSION}" "${URL}"
- name: Create PR
shell: bash
env:
Expand All @@ -56,6 +56,7 @@ jobs:
export BRANCH="${VERSION}-update-readme"
git checkout -b "${BRANCH}"
git add README.md
git add k8s/cloud/public/base/artifact_tracker_versions.yaml
git commit -s -m "$(cat pr_title)"
git push -f fork "${BRANCH}"
gh pr create --repo pixie-io/pixie \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ version="$2"
url="$3"

readme_path="README.md"
at_versions_path="k8s/cloud/public/base/artifact_tracker_versions.yaml"

latest_release_comment="<!--${artifact_type}-latest-release-->"

Expand All @@ -45,6 +46,11 @@ latest_release_line() {
echo "- [$(pretty_artifact_name) ${version}](${url})${latest_release_comment}"
}

# environment variable is uppercased
artifact_tracker_env_name="PL_${artifact_type^^}_VERSION"

yq -i ".spec.template.spec.containers[] |= select(.name == \"artifact-tracker-server\").env[] |= select(.name == \"${artifact_tracker_env_name}\").value = \"${version}\"" "${at_versions_path}"

sed -i 's|.*'"${latest_release_comment}"'.*|'"$(latest_release_line)"'|' "${readme_path}"

echo "[bot][releases] Update readme with link to latest ${artifact_type} release." > pr_title
Expand Down

0 comments on commit f7e42b1

Please sign in to comment.