Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions .github/workflows/helm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:
is_release:
type: boolean
default: false
dry_run:
type: boolean

jobs:
helm-publish:
Expand Down Expand Up @@ -49,11 +51,14 @@ jobs:
yq -i '.operator.image.repository = "ghcr.io/svix/diom-operator"' infra/helm-diom/values.yaml
yq -i '.cluster.image.repository = "ghcr.io/svix/diom-server"' infra/helm-diom/values.yaml

- name: Package and push chart
- name: Package chart
run: |
if [ -n "${{ inputs.version }}" ]; then
helm package ./infra/helm-diom --version ${{ inputs.version }}
else
helm package ./infra/helm-diom
fi
helm push diom*.tgz oci://ghcr.io/svix/charts

- name: Push chart
if: ${{ !inputs.dry_run }}
run: helm push diom*.tgz oci://ghcr.io/svix/charts
49 changes: 45 additions & 4 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ on:
workflow_dispatch:
inputs:
operator_image_tag:
required: true
description: "(Optional) Override operator image tag"
type: string
default: ''
server_image_tag:
required: true
description: "(Optional) Override server image tag"
type: string
default: ''
dry_run:
type: boolean
default: false
workflow_call:
inputs:
operator_image_tag:
Expand All @@ -19,14 +24,50 @@ on:
required: false
type: string
default: ''
dry_run:
type: boolean
default: false

jobs:
read-versions:
runs-on: ubuntu-24.04
outputs:
operator_image_tag: ${{ steps.versions.outputs.operator_image_tag }}
server_image_tag: ${{ steps.versions.outputs.server_image_tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Read versions from Cargo.toml
id: versions
run: |
if [ -n "${{ inputs.operator_image_tag }}" ]; then
OPERATOR_TAG="${{ inputs.operator_image_tag }}"
else
OPERATOR_TAG=$(cargo metadata --manifest-path infra/operator/Cargo.toml --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "diom-operator") | .version')
fi
if [ -n "${{ inputs.server_image_tag }}" ]; then
SERVER_TAG="${{ inputs.server_image_tag }}"
else
SERVER_TAG=$(cargo metadata --manifest-path server/Cargo.toml --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "diom-server") | .version')
fi
echo "operator_image_tag=${OPERATOR_TAG}" >> "$GITHUB_OUTPUT"
echo "server_image_tag=${SERVER_TAG}" >> "$GITHUB_OUTPUT"
- name: Dry run summary
if: ${{ inputs.dry_run }}
run: |
echo "=== DRY RUN ==="
echo "Would release helm chart with:"
echo " operator image tag: ${{ steps.versions.outputs.operator_image_tag }}"
echo " server image tag: ${{ steps.versions.outputs.server_image_tag }}"

publish:
needs: read-versions
uses: ./.github/workflows/helm-publish.yml
with:
operator_image_tag: ${{ inputs.operator_image_tag }}
server_image_tag: ${{ inputs.server_image_tag }}
operator_image_tag: ${{ needs.read-versions.outputs.operator_image_tag }}
server_image_tag: ${{ needs.read-versions.outputs.server_image_tag }}
is_release: true
dry_run: ${{ inputs.dry_run }}
secrets: inherit
permissions:
contents: read
Expand Down
Loading