From 1324781d6bce582b46c87ca2c459b70b9d5379ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tilen=20Barbiri=C4=8D?= Date: Wed, 31 Dec 2025 13:53:28 +0100 Subject: [PATCH] fix(templates): fix NOTES.txt template syntax errors - Fix invalid Go template syntax for accessing httpRoute path value - Remove redundant/broken ingress conditional block that caused EOF error --- .github/cr.yaml | 2 - .github/renovate.json | 13 --- .github/workflows/app_release.yaml | 78 -------------- .github/workflows/docs_update.yaml | 28 ----- .github/workflows/release.yaml | 159 ---------------------------- charts/jellyfin/templates/NOTES.txt | 16 +-- 6 files changed, 1 insertion(+), 295 deletions(-) delete mode 100644 .github/cr.yaml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/app_release.yaml delete mode 100644 .github/workflows/docs_update.yaml delete mode 100644 .github/workflows/release.yaml diff --git a/.github/cr.yaml b/.github/cr.yaml deleted file mode 100644 index b64b10c..0000000 --- a/.github/cr.yaml +++ /dev/null @@ -1,2 +0,0 @@ -owner: jellyfin -release-name-template: "{{ .Name }}-{{ .Version }}" \ No newline at end of file diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index d254565..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>jellyfin/.github//renovate-presets/default"], - "customManagers": [ - { - "customType": "regex", - "fileMatch": ["charts/jellyfin/Chart.yaml"], - "matchStrings": ["appVersion: (?.*?)\\n"], - "datasourceTemplate": "docker", - "depNameTemplate": "jellyfin/jellyfin" - } - ] -} diff --git a/.github/workflows/app_release.yaml b/.github/workflows/app_release.yaml deleted file mode 100644 index 397b99c..0000000 --- a/.github/workflows/app_release.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: Bump Helm Chart Version - -on: - push: - branches: - - main - workflow_dispatch: - inputs: - jellyfin_version: - description: 'Application version to set in Chart.yaml' - required: true - default: '1.0.0' - -jobs: - bump-version: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6 - with: - python-version: 3.x - - - name: Bump chart version and set appVersion - id: bump_version - run: | - # Read the current version from the Chart.yaml - current_version=$(grep '^version:' charts/jellyfin/Chart.yaml | awk '{print $2}') - echo "Current version: $current_version" - - # Split the version by dot and increment the minor version - major=$(echo "$current_version" | cut -d '.' -f 1) - minor=$(echo "$current_version" | cut -d '.' -f 2) - patch=$(echo "$current_version" | cut -d '.' -f 3) - new_version="$major.$((minor+1)).0" - - echo "New chart version: $new_version" - - # Get the app version passed as an input - jellyfin_version="${{ github.event.inputs.jellyfin_version }}" - echo "Setting appVersion to: $jellyfin_version" - - # Update the Chart.yaml with the new version and appVersion - sed -i "s/^version:.*/version: $new_version/" charts/jellyfin/Chart.yaml - sed -i "s/^appVersion:.*/appVersion: $jellyfin_version/" charts/jellyfin/Chart.yaml - - # Output the new chart version for further use - echo "new_version=$new_version" >> $GITHUB_OUTPUT - - - name: Commit changes - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add charts/jellyfin/Chart.yaml - git commit -m "chore(jellyfin): Bump chart version to ${{ steps.bump_version.outputs.new_version }} and set appVersion to ${{ github.event.inputs.jellyfin_version }}" - - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.JF_BOT_TOKEN }} - - - name: Create Git tag - id: create_tag - run: | - new_version="${{ steps.bump_version.outputs.new_version }}" - git tag "$new_version" - echo "Tag created: $new_version" - - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.JF_BOT_TOKEN }} - tags: true diff --git a/.github/workflows/docs_update.yaml b/.github/workflows/docs_update.yaml deleted file mode 100644 index 93a9d8d..0000000 --- a/.github/workflows/docs_update.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Docs Update - -on: - push: - branches: - - master - -permissions: - contents: write - packages: write - -jobs: - generate-docs: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - with: - fetch-depth: 0 - - - name: Helm Docs GitHub Action - uses: losisin/helm-docs-github-action@a57fae5676e4c55a228ea654a1bcaec8dd3cf5b5 # v1.6.2 - with: - git-push: true - git-commit-message: "docs(charts): :memo: write updated reademe" - - - name: Push changes - run: git push \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index f653314..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,159 +0,0 @@ -name: Release - -on: - push: - tags: - - '*' - -permissions: - contents: write - packages: write - -jobs: - release: - # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions - # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config --global user.name "jellyfin-bot" - git config --global user.email "team@jellyfin.org" - - - name: Install Helm - uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4 - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - - name: Install yq - run: | - # renovate: datasource=github-releases depName=mikefarah/yq - YQ_VERSION="4.44.3" - wget -q https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64 -O yq - chmod +x yq - sudo mv yq /usr/local/bin/yq - yq --version - - - name: Run chart-releaser - uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0 - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - with: - config: .github/cr.yaml - - - name: Extract chart metadata and format release notes - id: release-notes - run: | - CHART_PATH="charts/jellyfin" - CHART_NAME=$(yq eval '.name' "${CHART_PATH}/Chart.yaml") - CHART_VERSION=$(yq eval '.version' "${CHART_PATH}/Chart.yaml") - APP_VERSION=$(yq eval '.appVersion' "${CHART_PATH}/Chart.yaml") - RELEASE_TAG="${CHART_NAME}-${CHART_VERSION}" - - echo "tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT - - CHANGELOG_RAW=$(yq eval '.annotations."artifacthub.io/changes"' "${CHART_PATH}/Chart.yaml") - - # Build changelog section - CHANGELOG_SECTION="" - if [ "$CHANGELOG_RAW" != "null" ] && [ -n "$CHANGELOG_RAW" ]; then - CHANGELOG_SECTION="## What's Changed - - " - TEMP_FILE=$(mktemp) - SEPARATOR="|" - echo "$CHANGELOG_RAW" | yq eval ".[] | .kind + \"${SEPARATOR}\" + .description" - > "$TEMP_FILE" - - while IFS="${SEPARATOR}" read -r kind description; do - case "$kind" in - "added") - emoji="✨" - label="Added" - ;; - "changed") - emoji="🔄" - label="Changed" - ;; - "deprecated") - emoji="⚠️" - label="Deprecated" - ;; - "removed") - emoji="🗑️" - label="Removed" - ;; - "fixed") - emoji="🐛" - label="Fixed" - ;; - "security") - emoji="🔒" - label="Security" - ;; - *) - emoji="📝" - label="Changed" - ;; - esac - CHANGELOG_SECTION="${CHANGELOG_SECTION}- ${emoji} **${label}**: ${description} - " - done < "$TEMP_FILE" - - rm -f "$TEMP_FILE" - CHANGELOG_SECTION="${CHANGELOG_SECTION} - " - fi - - # Build release body - RELEASE_BODY="## Jellyfin Helm Chart v${CHART_VERSION} - - **Application Version**: \`${APP_VERSION}\` - - ${CHANGELOG_SECTION}## Installation - - Add the Jellyfin Helm repository: - - \`\`\`bash - helm repo add jellyfin https://jellyfin.github.io/jellyfin-helm - helm repo update - \`\`\` - - Install the chart: - - \`\`\`bash - helm install my-jellyfin jellyfin/jellyfin --version ${CHART_VERSION} - \`\`\` - - ## Upgrade - - \`\`\`bash - helm upgrade my-jellyfin jellyfin/jellyfin --version ${CHART_VERSION} - \`\`\` - - --- - - 📦 **Chart**: \`jellyfin\` v${CHART_VERSION} - 🎬 **Jellyfin**: v${APP_VERSION} - 📖 **Documentation**: https://github.com/jellyfin/jellyfin-helm/blob/main/charts/jellyfin/README.md - " - - # Save to file - echo "$RELEASE_BODY" > release-notes.md - - - name: Update release notes - env: - GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - run: | - RELEASE_TAG="${{ steps.release-notes.outputs.tag }}" - - # Update release notes - gh release edit "$RELEASE_TAG" --notes-file release-notes.md - - echo "✅ Updated release notes for $RELEASE_TAG" diff --git a/charts/jellyfin/templates/NOTES.txt b/charts/jellyfin/templates/NOTES.txt index 900215c..fd7428e 100644 --- a/charts/jellyfin/templates/NOTES.txt +++ b/charts/jellyfin/templates/NOTES.txt @@ -124,27 +124,13 @@ HTTPRoute (Gateway API) is ENABLED: Access Jellyfin via Gateway API at: {{- if .Values.httpRoute.hostnames }} {{- range .Values.httpRoute.hostnames }} - https://{{ . }}{{ (index $.Values.httpRoute.rules 0).matches 0 .path.value }} + https://{{ . }}{{ with (index $.Values.httpRoute.rules 0) }}{{ with (index .matches 0) }}{{ .path.value }}{{ end }}{{ end }} {{- end }} {{- else }} (Configure httpRoute.hostnames for external access) {{- end }} Note: Ensure your Gateway API CRDs are installed and Gateway is configured. -{{- else if .Values.ingress.enabled }} -{{- if .Values.ingress.enabled }} - -Jellyfin is available via Ingress at: -{{- range .Values.ingress.hosts }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .host }}{{ (index .paths 0).path }} -{{- end }} -{{- else }} - -To access Jellyfin, you can use port-forwarding: - - $ kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "jellyfin.fullname" . }} {{ .Values.service.port }}:{{ .Values.service.port }} - -Then visit http://localhost:{{ .Values.service.port }} in your browser. {{- end }} {{- if .Values.networkPolicy.enabled }}