From 499bcbc51703452cfacc16dcea6bc3134560991f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 11:45:27 +0000 Subject: [PATCH 1/3] Publish the Helm chart as an OCI artifact on GHCR Add helm-publish.yml (skips versions already published), check that the chart appVersion matches package.json, add Artifact Hub annotations, bump the chart to 0.1.4 and document the OCI install. Refs Doezer/Questarr-mgmt#106 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01RP6NCTVU7pRFVB9Pt1m4hK --- .claude/skills/bump-questarr-version/SKILL.md | 2 +- .github/workflows/helm-chart.yml | 10 +++ .github/workflows/helm-publish.yml | 82 +++++++++++++++++++ README.md | 10 +-- charts/questarr/Chart.yaml | 8 +- charts/questarr/README.md | 9 +- 6 files changed, 112 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/helm-publish.yml diff --git a/.claude/skills/bump-questarr-version/SKILL.md b/.claude/skills/bump-questarr-version/SKILL.md index 70a7692f5..833217367 100644 --- a/.claude/skills/bump-questarr-version/SKILL.md +++ b/.claude/skills/bump-questarr-version/SKILL.md @@ -12,7 +12,7 @@ Files to update to the new version (OLD -> NEW): 3. Home Assistant add-on: `questarr/config.yaml` (`version`) and `questarr/Dockerfile` (`ARG QUESTARR_VERSION`). 4. Umbrel: `doezer-questarr/umbrel-app.yml` (`version`). 5. CasaOS: `casaos/docker-compose.yml` (`x-casaos.version`). -6. Helm: `charts/questarr/Chart.yaml` `appVersion` = NEW and chart `version` patch bump (0.1.x -> 0.1.x+1, required on every chart change); example tag in `charts/questarr/README.md` (`v` + NEW). +6. Helm: `charts/questarr/Chart.yaml` `appVersion` = NEW and chart `version` patch bump (0.1.x -> 0.1.x+1, required on every chart change; `helm-publish.yml` publishes a new chart version to GHCR on merge and `helm-chart.yml` fails if `appVersion` differs from `package.json`); example tag in `charts/questarr/README.md` (`v` + NEW). 7. `docs/PRD.md`: the `**Version:**` line. Check, don't blindly change: diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 25308f90c..ba045e684 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -34,6 +34,16 @@ jobs: - name: Show Helm version run: helm version + # The chart ships the Questarr version it installs by default, so it must follow package.json. + - name: Check appVersion matches package.json + run: | + app_version=$(sed -n 's/^appVersion: "\{0,1\}\([^"]*\)"\{0,1\}$/\1/p' charts/questarr/Chart.yaml) + pkg_version=$(jq -r .version package.json) + if [ "$app_version" != "$pkg_version" ]; then + echo "::error::charts/questarr/Chart.yaml appVersion ($app_version) differs from package.json version ($pkg_version)" + exit 1 + fi + - name: Lint the chart with default values run: helm lint charts/questarr diff --git a/.github/workflows/helm-publish.yml b/.github/workflows/helm-publish.yml new file mode 100644 index 000000000..39ac8bc86 --- /dev/null +++ b/.github/workflows/helm-publish.yml @@ -0,0 +1,82 @@ +name: Helm chart publish + +# Publishes charts/questarr as an OCI artifact on GHCR: +# helm install questarr oci://ghcr.io/doezer/charts/questarr --version +# The chart `version` in Chart.yaml must be bumped on every chart change (helm-chart.yml and the +# bump-questarr-version skill already require it). A version that is already published is left +# untouched, so re-running this workflow or merging a change without a bump never overwrites a +# released chart. + +on: + push: + branches: [main] + paths: + - "charts/**" + - ".github/workflows/helm-publish.yml" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: helm-publish + cancel-in-progress: false + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit + + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6.2.0 + with: + persist-credentials: false + + - name: Lint the chart + run: helm lint charts/questarr + + - name: Read chart metadata + id: chart + run: | + echo "name=$(helm show chart charts/questarr | sed -n 's/^name: //p')" >> "$GITHUB_OUTPUT" + echo "version=$(helm show chart charts/questarr | sed -n 's/^version: //p')" >> "$GITHUB_OUTPUT" + + - name: Log in to GHCR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ACTOR: ${{ github.actor }} + run: echo "$GITHUB_TOKEN" | helm registry login ghcr.io --username "$ACTOR" --password-stdin + + - name: Publish the chart if this version is new + env: + CHART_NAME: ${{ steps.chart.outputs.name }} + CHART_VERSION: ${{ steps.chart.outputs.version }} + OWNER: ${{ github.repository_owner }} + run: | + set -euo pipefail + owner_lc=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]') + ref="oci://ghcr.io/${owner_lc}/charts" + if helm show chart "${ref}/${CHART_NAME}" --version "${CHART_VERSION}" > /dev/null 2>&1; then + echo "Chart ${CHART_NAME} ${CHART_VERSION} is already published; nothing to do." + exit 0 + fi + helm package charts/questarr --destination dist-chart + helm push "dist-chart/${CHART_NAME}-${CHART_VERSION}.tgz" "${ref}" + { + echo "## Helm chart published" + echo + echo "- **Chart:** ${ref}/${CHART_NAME}" + echo "- **Version:** ${CHART_VERSION}" + echo + echo '```bash' + echo "helm install questarr ${ref}/${CHART_NAME} --version ${CHART_VERSION} --namespace questarr --create-namespace" + echo '```' + } >> "$GITHUB_STEP_SUMMARY" diff --git a/README.md b/README.md index ce4b0e359..d186dbc2d 100644 --- a/README.md +++ b/README.md @@ -242,15 +242,15 @@ Questarr is available in the Unraid **Apps** tab via Community Applications:
Install with the bundled Helm chart -A Helm chart lives in [`charts/questarr`](charts/questarr). It is not published to a Helm -repository yet, so install it from a clone: +A Helm chart lives in [`charts/questarr`](charts/questarr) and is published as an OCI chart on +GitHub Container Registry: ```bash -git clone https://github.com/Doezer/Questarr.git -cd Questarr -helm install questarr charts/questarr --namespace questarr --create-namespace +helm install questarr oci://ghcr.io/doezer/charts/questarr --namespace questarr --create-namespace ``` +You can also install it from a clone with `helm install questarr charts/questarr`. + Then port-forward (or enable the Ingress) and open the UI: ```bash diff --git a/charts/questarr/Chart.yaml b/charts/questarr/Chart.yaml index 6a1d0cd66..02b3663b8 100644 --- a/charts/questarr/Chart.yaml +++ b/charts/questarr/Chart.yaml @@ -3,7 +3,7 @@ name: questarr description: Questarr — an *Arr-inspired game manager that helps you discover, track, and automatically download the games you want. type: application # Chart version — bump on every chart change (SemVer). -version: 0.1.3 +version: 0.1.4 # Version of Questarr shipped by default (image tag adds the v release prefix). appVersion: "1.6.0" kubeVersion: ">=1.23.0-0" @@ -23,3 +23,9 @@ maintainers: annotations: category: MediaManagement licenses: GPL-3.0-only + artifacthub.io/license: GPL-3.0-only + artifacthub.io/links: | + - name: Documentation + url: https://github.com/Doezer/Questarr/tree/main/docs + - name: Support + url: https://github.com/Doezer/Questarr/issues diff --git a/charts/questarr/README.md b/charts/questarr/README.md index c0a7d33ff..6790f7f04 100644 --- a/charts/questarr/README.md +++ b/charts/questarr/README.md @@ -15,8 +15,13 @@ state Questarr persists). ## Install -The chart is not published to a Helm repository yet — install it from a clone of the -repository: +The chart is published as an OCI chart on GitHub Container Registry (Helm >= 3.8): + +```bash +helm install questarr oci://ghcr.io/doezer/charts/questarr --namespace questarr --create-namespace +``` + +Pin a chart version with `--version `. To install from a clone instead: ```bash git clone https://github.com/Doezer/questarr.git From e3826468235b7923c8566a6ad7c5ca9e6f247a85 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 11:46:48 +0000 Subject: [PATCH 2/3] Run the appVersion check on package.json changes and fail on unclear registry errors Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01RP6NCTVU7pRFVB9Pt1m4hK --- .github/workflows/helm-chart.yml | 2 ++ .github/workflows/helm-publish.yml | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index ba045e684..d0d0a4803 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -5,11 +5,13 @@ on: branches: [main, release/*] paths: - "charts/**" + - "package.json" - ".github/workflows/helm-chart.yml" pull_request: branches: [main, release/*] paths: - "charts/**" + - "package.json" - ".github/workflows/helm-chart.yml" workflow_dispatch: diff --git a/.github/workflows/helm-publish.yml b/.github/workflows/helm-publish.yml index 39ac8bc86..7265bc850 100644 --- a/.github/workflows/helm-publish.yml +++ b/.github/workflows/helm-publish.yml @@ -64,9 +64,15 @@ jobs: set -euo pipefail owner_lc=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]') ref="oci://ghcr.io/${owner_lc}/charts" - if helm show chart "${ref}/${CHART_NAME}" --version "${CHART_VERSION}" > /dev/null 2>&1; then + # Only a "not found" answer from the registry means the version is free to publish. Any + # other failure (network, outage, rate limit, auth) must fail the job rather than risk + # overwriting a released chart version. + if out=$(helm show chart "${ref}/${CHART_NAME}" --version "${CHART_VERSION}" 2>&1); then echo "Chart ${CHART_NAME} ${CHART_VERSION} is already published; nothing to do." exit 0 + elif ! grep -qiE 'not found|manifest unknown|name unknown' <<<"$out"; then + echo "::error::Could not check for an existing chart: $out" + exit 1 fi helm package charts/questarr --destination dist-chart helm push "dist-chart/${CHART_NAME}-${CHART_VERSION}.tgz" "${ref}" From 44449a40f780bec4ad74c1a2874c0d113373a4bb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 11:54:35 +0000 Subject: [PATCH 3/3] Install the clone-based Helm example in the questarr namespace Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01RP6NCTVU7pRFVB9Pt1m4hK --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d186dbc2d..96a5455cb 100644 --- a/README.md +++ b/README.md @@ -249,7 +249,8 @@ GitHub Container Registry: helm install questarr oci://ghcr.io/doezer/charts/questarr --namespace questarr --create-namespace ``` -You can also install it from a clone with `helm install questarr charts/questarr`. +You can also install it from a clone with +`helm install questarr charts/questarr --namespace questarr --create-namespace`. Then port-forward (or enable the Ingress) and open the UI: