Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarbian-sap committed Jul 28, 2023
1 parent 403b6c7 commit 209adbc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
if [ -z "$(git status --porcelain)" ]; then
echo "Generated artifacts are up-to-date."
else
>&1 echo "Generated artifacts are not up-to-date; probably 'make generate' was not run before committing."
>&2 echo "Generated artifacts are not up-to-date; probably 'make generate' was not run before committing."
exit 1
fi
Expand All @@ -63,7 +63,7 @@ jobs:
if [ -z "$(git status --porcelain)" ]; then
echo "Manifests are up-to-date."
else
>&1 echo "Manifests are not up-to-date; probably 'make manifests' was not run before committing."
>&2 echo "Manifests are not up-to-date; probably 'make manifests' was not run before committing."
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
chart_version=$(yq .version $CHART_DIRECTORY/Chart.yaml)
app_version=$(yq .appVersion $CHART_DIRECTORY/Chart.yaml)
if [ "v$chart_version" != "${{ github.event.release.tag_name }}" ]; then
>&1 echo "Version in $CHART_DIRECTORY/Chart.yaml ($chart_version) does not match release version (${{ github.event.release.tag_name }})."
>&2 echo "Version in $CHART_DIRECTORY/Chart.yaml ($chart_version) does not match release version (${{ github.event.release.tag_name }})."
exit 1
fi
if [ "$app_version" != "${{ github.event.release.tag_name }}" ]; then
>&1 echo "AppVersion in $CHART_DIRECTORY/Chart.yaml ($app_version) does not match release version (${{ github.event.release.tag_name }})."
>&2 echo "AppVersion in $CHART_DIRECTORY/Chart.yaml ($app_version) does not match release version (${{ github.event.release.tag_name }})."
exit 1
fi
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ jobs:
permissions:
contents: write

# TODO: ensure that github.ref is not refs/tags/*
# TODO: maybe even ensure that github.ref == refs/heads/main
steps:
- name: Validate ref
run: |
if [ "${{ github.ref }}" != refs/heads/main ]; then
>&2 echo "Invalid ref: ${{ github.ref }} (expected: refs/heads/main)"
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -76,7 +81,7 @@ jobs:
# ok
;;
*)
>&1 echo "Invalid input: version-bump ($version_bump)."
>&2 echo "Invalid input: version-bump ($version_bump)."
exit 1
esac
if [ -z "$current_version" ]; then
Expand All @@ -91,15 +96,15 @@ jobs:
version=${BASH_REMATCH[1]}
tag=$desired_version
else
>&1 echo "Invalid input: desired-version ($desired_version) should start with $TAG_PREFIX."
>&2 echo "Invalid input: desired-version ($desired_version) should start with $TAG_PREFIX."
exit 1
fi
if [ "$(semver validate $version)" != valid ]; then
>&1 echo "Invalid input: desired-version ($version) is not a valid semantic version."
>&2 echo "Invalid input: desired-version ($version) is not a valid semantic version."
exit 1
fi
if [ "$(semver compare $version $current_version)" -le 0 ]; then
>&1 echo "Invalid input: desired-version ($version) should be higher than current version ($current_version)."
>&2 echo "Invalid input: desired-version ($version) should be higher than current version ($current_version)."
exit 1
fi
fi
Expand Down

0 comments on commit 209adbc

Please sign in to comment.