Skip to content
Open
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
44 changes: 36 additions & 8 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Image

# Build and push the konnector + backend images and Helm charts on tags:
# - tags v* -> ghcr.io/<owner>/konnector:<version>, ghcr.io/<owner>/backend:<version>
# - tags v* -> oci://ghcr.io/<owner>/charts/{konnector-v2,backend-v2}:<version>
# No :latest or :<sha> tags — the image repo is shared with v1/main images.
# Build and push the konnector + backend images and Helm charts:
# - tags v* -> ghcr.io/<owner>/{konnector,backend}:<tag> (+ :latest on final releases)
# - tags v* -> oci://ghcr.io/<owner>/charts/{konnector-v2,backend-v2}:<version>
# - main pushes -> ghcr.io/<owner>/{konnector,backend}:main and :<sha>
# - main pushes -> oci://ghcr.io/<owner>/charts/{konnector-v2,backend-v2}:0.0.0-<sha>
on:
push:
tags:
- 'v*'
branches:
- main

permissions:
contents: read
Expand All @@ -31,14 +34,32 @@ jobs:

# Multi-arch via in-Dockerfile cross-compile (builder pinned to
# BUILDPLATFORM), so no QEMU is required.
# Final release tags also move :latest, main pushes get :main and :<sha>.
- name: Compute image tags
id: tags
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
tags="${GITHUB_REF_NAME}"
if [[ "${GITHUB_REF_NAME}" != *-* ]]; then
tags="${tags} latest"
fi
else
tags="main ${GITHUB_SHA}"
fi
echo "tags=${tags}" >> "$GITHUB_OUTPUT"

- name: Build and push
run: |
owner="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
for target in konnector backend; do
tag_args=""
for tag in ${{ steps.tags.outputs.tags }}; do
tag_args="${tag_args} --tag ghcr.io/${owner}/${target}:${tag}"
done
docker buildx build \
--platform linux/amd64,linux/arm64 \
--target "${target}" \
--tag "ghcr.io/${owner}/${target}:${GITHUB_REF_NAME}" \
${tag_args} \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
--label "org.opencontainers.image.title=${target}" \
Expand All @@ -60,11 +81,18 @@ jobs:
- name: Log in to GHCR for Helm
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io --username ${{ github.actor }} --password-stdin

- name: Version from tag
- name: Chart version
id: v
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
echo "image_version=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
else
echo "version=0.0.0-${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
echo "image_version=${GITHUB_SHA}" >> "$GITHUB_OUTPUT"
fi

- name: Package and push Helm charts (OCI)
run: |
owner="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
make helm-push VERSION=${{ steps.v.outputs.version }} HELM_REPO="ghcr.io/${owner}/charts"
make helm-push VERSION=${{ steps.v.outputs.version }} IMAGE_VERSION=${{ steps.v.outputs.image_version }} HELM_REPO="ghcr.io/${owner}/charts"
6 changes: 4 additions & 2 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ The same workflow publishes `konnector-v2` and `backend-v2` OCI Helm charts
under `oci://ghcr.io/<owner>/charts`. Their chart version drops the leading
`v`, while `appVersion` retains it to select the matching image tag.

There is no `:latest` or `:<sha>` tag, the image registry is shared with the
0.x/`v1` images, so only the exact version tag is published.
Final release tags also move the `:latest` image tag. Pushes to `main`
publish development images tagged `:main` and `:<sha>`, plus matching dev
charts versioned `0.0.0-<sha>` (their `appVersion` pins the `<sha>` image).
Prerelease tags publish only the exact version tag.

The [CLI workflow](../.github/workflows/cli.yaml) publishes CLI archives and
updates krew only for final tags. Prerelease users must build the CLI from
Expand Down