diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 80f92ab..3155c7d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index affbb20..409fd1e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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