From 3b76fb2647c93e2107ce37fe00b99d16657d615d Mon Sep 17 00:00:00 2001 From: Jory Irving <46251616+joryirving@users.noreply.github.com> Date: Sun, 23 Nov 2025 05:24:14 -0700 Subject: [PATCH] Allow manual helm chart publishing for specific tags (#1174) --- .github/workflows/helm-release-chart.yml | 64 ++++++++++++++---------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/helm-release-chart.yml b/.github/workflows/helm-release-chart.yml index 4058a82a..b898ba66 100644 --- a/.github/workflows/helm-release-chart.yml +++ b/.github/workflows/helm-release-chart.yml @@ -2,41 +2,53 @@ name: Release Helm Chart on: push: tags: - - v* + - v* workflow_dispatch: + inputs: + channel: + description: 'Release channel (master, edge, or leave blank for tag-based)' + required: false + default: 'master' jobs: release: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v5 + - name: Checkout code + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - - name: Set up Helm - uses: azure/setup-helm@v4 + - name: Set up Helm + uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1 - - name: Log in to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Log in to GHCR + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Update Helm Dependencies - run: | - helm dependency update ./chart + - name: Update Helm Dependencies + run: helm dependency update ./chart - - name: Package Helm Chart - run: | - export tag=$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//') - helm package ./chart --version $tag --app-version $tag - - - name: Build Helm-safe repo name - run: | - REPO_NAME="$(echo "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts" | tr '[:upper:]' '[:lower:]')" - echo "REPO_NAME=${REPO_NAME}" >> "${GITHUB_ENV}" + - name: Determine Chart Version + id: version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + TAG="${{ github.event.inputs.channel }}" + else + TAG=$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//') + fi + echo "TAG=$TAG" >> "${GITHUB_ENV}" + echo "Using chart version: $TAG" - - name: Push Helm Chart to GHCR - run: | - helm push kyoo-*.tgz "${REPO_NAME}" + - name: Package Helm Chart + run: helm package ./chart --version $TAG --app-version $TAG + + - name: Build Helm-safe repo name + run: | + REPO_NAME="$(echo "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/helm-charts" | tr '[:upper:]' '[:lower:]')" + echo "REPO_NAME=${REPO_NAME}" >> "${GITHUB_ENV}" + + - name: Push Helm Chart to GHCR + run: helm push kyoo-*.tgz "${REPO_NAME}"