Skip to content
Open
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
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
packages: write
pull-requests: write
jobs:
release:
Expand Down Expand Up @@ -59,3 +60,24 @@ jobs:
config: .github/cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Push charts to GHCR
if: steps.changesets.outputs.hasChangesets == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OCI_REPO: oci://ghcr.io/clickhouse/charts
run: |
echo "$GH_TOKEN" | helm registry login ghcr.io -u "$GITHUB_ACTOR" --password-stdin
pkgs=$(mktemp -d)
# Push the GitHub release asset, not a fresh package, so GHCR serves the same bytes as the Pages repo.
for chart in charts/*/Chart.yaml; do
read -r name version < <(yq '.name + " " + .version' "$chart")
tag="$name-$version"
if ! gh release view "$tag" >/dev/null 2>&1; then
echo "$tag has no GitHub release, skipping"
elif helm show chart "$OCI_REPO/$name" --version "$version" >/dev/null 2>&1; then
echo "$tag already in $OCI_REPO, skipping"
else
gh release download "$tag" -p "$tag.tgz" -D "$pkgs"
helm push "$pkgs/$tag.tgz" "$OCI_REPO"
fi
done
Loading