Skip to content

Commit

Permalink
fix: attempts to fix the bump again (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
faiq authored Mar 13, 2024
1 parent 5b693bd commit 8d9fbe4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/release-kib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
- name: Get KIB Version
run: |
PREV_VERSION=$(make --silent get-kib-version)
echo "prev_version=$PREV_VERSION" >> "$GITHUB_ENV"
working-directory: cluster-api-provider-preprovisioned

- name: Update Konvoy-image-builder version in mesosphere/cluster-api-provider-preprovisioned repository
Expand All @@ -84,7 +85,7 @@ jobs:
run: |
make install-semver
export SEMVER_CLI_BIN=.local/semver-cli/semver
PR_TYPE=$(hack/version-diff.sh --version-latest ${{ github.ref_name }} --version-previous $PREV_VERSION)
PR_TYPE=$(hack/version-diff.sh --version-latest ${{ github.ref_name }} --version-previous ${{ env.prev_version }})
echo "pr_type=$PR_TYPE" >> "$GITHUB_ENV"
- name: Create Pull Request for KIB bump in CAPPP
Expand All @@ -93,6 +94,6 @@ jobs:
token: ${{ secrets.MESOSPHERECI_USER_TOKEN }}
add-paths: preprovisioned/kib
body: bumps KIB to latest version
commit-message: "$pr_type: bump kib to ${{ github.ref_name }}"
commit-message: "${{ env.pr_type }}: bump kib to ${{ github.ref_name }}"
path: cluster-api-provider-preprovisioned
title: "${{ env.pr_type }}: bump kib to ${{ github.ref_name }}"
7 changes: 5 additions & 2 deletions hack/version-diff.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
#
set -e

# According to:
# https://github.com/cli/cli/blob/235fdcdcc4c3df76adb4a84ecb0ba1ad470fbf5b/pkg/cmd/release/list/http.go#L32
Expand All @@ -17,8 +19,9 @@ while [ "$1" != "" ]; do
shift
done

if [[ -z $version_latest || -z $version_previous ]]; then
read -r version_latest version_previous <<< "$(${GITHUB_CLI_BIN} release list -L 2 | awk '{print $1}' | xargs)"
if [[ -z "${version_latest}" || -z "${version_previous}" ]]; then
printf "both version_latest and version_previous must be set"
exit 1
fi

DIFF="$(${SEMVER_CLI_BIN} diff "${version_latest}" "${version_previous}")"
Expand Down

0 comments on commit 8d9fbe4

Please sign in to comment.