Skip to content

Commit

Permalink
update .github/workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarbian-sap committed Jul 6, 2023
1 parent 59d113e commit 95ebea3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
fi
head -n $boilerplate_linecount $f > $tempdir/out
if ! diff -q $tempdir/out $boilerplate >/dev/null; then
>&1 echo "Error: incorrect license header: $f."
>&1 echo "Error: incorrect license header found in $f."
errors=$((errors+1))
fi
rm -f $tempdir/out
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
fi
if [ $(semver compare $new_version $old_version) -lt 0 ]; then
echo "Target appVersion ($new_version) is lower than current appVersion ($old_version); skipping update."
echo "Target appVersion ($new_version) is lower than current appVersion ($old_version); skipping update ..."
exit 0
fi
Expand All @@ -277,7 +277,7 @@ jobs:
if [ "$version_bump" != major ] && [ "$version_bump" != minor ]; then
version_bump=patch
fi
echo "Performing chart version bump: $version_bump."
echo "Performing chart version bump: $version_bump ..."
echo "Updating custom resource definitions ($chart_directory/crds) ..."
rm -rf $chart_directory/crds
Expand All @@ -287,7 +287,7 @@ jobs:
perl -pi -e "s#^appVersion:.*#appVersion: $new_version#g" $chart_directory/Chart.yaml
if [ -z "$(git status --porcelain)" ]; then
echo "Nothing has changed; skipping commit/push."
echo "Nothing has changed; skipping commit/push ..."
exit 0
fi
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,36 +72,40 @@ jobs:
exit 1
esac
if [ -z "$current_version" ]; then
version=${INITIAL_TAG/#$TAG_PREFIX/}
tag=$INITIAL_TAG
else
tag=$TAG_PREFIX$(semver bump $version_bump $current_version)
version=$(semver bump $version_bump $current_version)
tag=$TAG_PREFIX$version
fi
else
if [[ $desired_version =~ ^$TAG_PREFIX([0-9].*)$ ]]; then
version=${BASH_REMATCH[1]}
tag=$desired_version
desired_version=${BASH_REMATCH[1]}
else
>&1 echo "Invalid input: desired-version ($desired_version) should start with $TAG_PREFIX."
exit 1
fi
if [ "$(semver validate $desired_version)" != valid ]; then
>&1 echo "Invalid input: desired-version ($desired_version) is not a valid semantic version."
if [ "$(semver validate $version)" != valid ]; then
>&1 echo "Invalid input: desired-version ($version) is not a valid semantic version."
exit 1
fi
if [ "$(semver compare $desired_version $current_version)" -le 0 ]; then
>&1 echo "Invalid input: desired-version ($desired_version) should be higher than current version ($current_version)."
if [ "$(semver compare $version $current_version)" -le 0 ]; then
>&1 echo "Invalid input: desired-version ($version) should be higher than current version ($current_version)."
exit 1
fi
fi
echo "Target tag: $tag."
echo "Target version: $version"
echo "Target tag: $tag"
echo "version=$version" >> $GITHUB_OUTPUT
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Determine target commit
id: get_target_commit
run: |
sha=$(git rev-parse HEAD)
echo "Target commit: $sha."
echo "Target commit: $sha"
echo "sha=$sha" >> $GITHUB_OUTPUT
- name: Create Release
Expand Down

0 comments on commit 95ebea3

Please sign in to comment.