Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): do not sign with no real chart update. #576

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ jobs:

- name: Publish and sign kubewarden-crds chart in OCI registry
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ex
chart_name=kubewarden-crds
Expand All @@ -162,6 +164,15 @@ jobs:
echo "$chart_path does not exist. Assuming no charts update"
exit 0
fi

# check if the chart version is already release. If so, do nothing
chart_version=$(helm show chart $chart_path | yq -r '.version')
if gh release view $chart_name-$chart_version; then
echo "Chart $chart_name-$chart_version already released. Skipping"
exit 0
fi


REGISTRY="ghcr.io/$GITHUB_REPOSITORY_OWNER/charts"
echo "REGISTRY=${REGISTRY}" >> "$GITHUB_ENV"
push_output=$(helm push $chart_path "oci://$REGISTRY" 2>&1)
Expand All @@ -180,6 +191,8 @@ jobs:

- name: Publish and sign kubewarden-controller chart in OCI registry
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ex
chart_name=kubewarden-controller
Expand All @@ -190,6 +203,14 @@ jobs:
echo "$chart_path does not exist. Assuming no charts update"
exit 0
fi

# check if the chart version is already release. If so, do nothing
chart_version=$(helm show chart $chart_path | yq -r '.version')
if gh release view $chart_name-$chart_version; then
echo "Chart $chart_name-$chart_version already released. Skipping"
exit 0
fi

REGISTRY="ghcr.io/$GITHUB_REPOSITORY_OWNER/charts"
echo "REGISTRY=${REGISTRY}" >> "$GITHUB_ENV"
push_output=$(helm push $chart_path "oci://$REGISTRY" 2>&1)
Expand All @@ -208,6 +229,8 @@ jobs:

- name: Publish and sign kubewarden-defaults chart in OCI registry
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ex
chart_name=kubewarden-defaults
Expand All @@ -218,6 +241,14 @@ jobs:
echo "$chart_path does not exist. Assuming no charts update"
exit 0
fi

# check if the chart version is already release. If so, do nothing
chart_version=$(helm show chart $chart_path | yq -r '.version')
if gh release view $chart_name-$chart_version; then
echo "Chart $chart_name-$chart_version already released. Skipping"
exit 0
fi

REGISTRY="ghcr.io/$GITHUB_REPOSITORY_OWNER/charts"
echo "REGISTRY=${REGISTRY}" >> "$GITHUB_ENV"
push_output=$(helm push $chart_path "oci://$REGISTRY" 2>&1)
Expand Down
Loading