From cffd27a7f465775f894e9bf022f2bfba4823cf36 Mon Sep 17 00:00:00 2001 From: Ryan Draga Date: Wed, 4 Nov 2026 21:43:29 -0500 Subject: [PATCH] CI changes --- .github/workflows/ci.yml | 17 ++++++++++++++++- README.md | 10 ++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d883112..0e3abdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -428,6 +428,19 @@ jobs: fi git push origin "v${VERSION}" + chart_dir="${RUNNER_TEMP}/helm-index" + prev="${RUNNER_TEMP}/helm-index-prev" + rm -rf "$chart_dir" "$prev" + mkdir -p "$chart_dir" "$prev" + cp "dist/squirrelbot-${VERSION}.tgz" "$chart_dir/" + index_url="https://github.com/${GITHUB_REPOSITORY}/releases/download/v${VERSION}" + merge_args=() + if gh release download --pattern index.yaml --dir "$prev" --clobber >/dev/null 2>&1; then + merge_args=(--merge "$prev/index.yaml") + fi + helm repo index "$chart_dir" --url "$index_url" "${merge_args[@]}" + cp "$chart_dir/index.yaml" dist/index.yaml + latest=$(git tag --list 'v*' --sort=-v:refname | awk -v current="v${VERSION}" '$0 != current && /^v[0-9]+\.[0-9]+\.[0-9]+$/ { print; exit }') notes="${RUNNER_TEMP}/notes.md" { @@ -436,7 +449,8 @@ jobs: echo "Helm chart:" echo echo '```sh' - echo "helm upgrade --install squirrelbot oci://${CHART}/squirrelbot --version ${VERSION}" + echo "helm repo add squirrelbot https://github.com/${GITHUB_REPOSITORY}/releases/latest/download" + echo "helm upgrade --install squirrelbot squirrelbot/squirrelbot --version ${VERSION}" echo '```' echo echo "Binary archives include \`squirrelbot\`, \`web/build\`, and \`LICENSE\`. Extract an archive and run \`./squirrelbot\` from that directory." @@ -455,6 +469,7 @@ jobs: --title "v${VERSION}" \ --notes-file "$notes" \ "dist/SHA256SUMS" \ + "dist/index.yaml" \ dist/squirrelbot_"${VERSION}"_*.tar.gz \ "dist/squirrelbot-${VERSION}.tgz" diff --git a/README.md b/README.md index 903e87d..5f3c491 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Copy `.env.example` to `.env` and fill in the Discord token, OAuth client id, OA The chart is `deploy/helm/squirrelbot`. It runs one replica with the Recreate strategy, a read-only root filesystem, and a non-root user. Liveness is `/healthz`. Readiness is `/readyz`, which stays down until Postgres answers and the Discord gateway is ready. -Supply secrets with `--set`, a private values file, or `existingSecret`. The secret keys are `DATABASE_URL`, `DISCORD_TOKEN`, `DISCORD_CLIENT_ID`, `DISCORD_CLIENT_SECRET`, and `SESSION_SECRET`. +`--set` and a private values file make the chart create the Secret. To use a Secret that already exists, set `existingSecret` to its name. The chart then mounts that Secret and does not create one. The keys are `DATABASE_URL`, `DISCORD_TOKEN`, `DISCORD_CLIENT_ID`, `DISCORD_CLIENT_SECRET`, and `SESSION_SECRET`. `deploy/flux/squirrelbot-kustomization.yaml` is a Flux Kustomization for the published chart. It reconciles `deploy/flux/squirrelbot`. Create a Secret named `squirrelbot` in the `squirrelbot` namespace before the first reconcile, with those keys. Point `sourceRef` at your Flux GitRepository when it is not named `flux-system`. Pin `version` in the HelmRelease to stop automatic upgrades. @@ -88,10 +88,16 @@ Each release includes: - Archives for Linux and macOS, on amd64 and arm64. An archive contains `squirrelbot`, `web/build`, and `LICENSE`. Extract it and run `./squirrelbot` from that directory. - The image `ghcr.io/boxingoctopuscreative/squirrelbot`, tagged with the version and with `latest`. -- The Helm chart, attached to the GitHub release and published to `oci://ghcr.io/boxingoctopuscreative/charts/squirrelbot`. +- The Helm chart, attached to the GitHub release and published to `oci://ghcr.io/boxingoctopuscreative/charts/squirrelbot`. Each release also carries an `index.yaml`, so Helm can add the release archive as a chart repository. The published chart uses that GHCR image. The chart in this repository keeps the local image name `squirrelbot`, which matches `make image`. Install the published chart with the same `--set` values as the local chart, and set `--version` to the release you want. +```sh +helm repo add squirrelbot https://github.com/BoxingOctopusCreative/SquirrelBot/releases/latest/download +helm repo update +helm upgrade --install squirrelbot squirrelbot/squirrelbot --version 0.1.0 +``` + CI sets the GHCR package visibility to match the repository. ## License