Release Workflow
Reference documentation for the GitHub Actions release workflow that builds multi-architecture container images, publishes them to GHCR, and creates GitHub Releases with install artifacts.
Source: .github/workflows/release.yml
Overview
The release workflow is triggered when a version tag matching v* is pushed (e.g., v0.1.0, v1.0.0). It produces two outputs:
- Multi-arch container image pushed to GHCR with semver tags.
- GitHub Release with changelog and downloadable install artifacts.
| Job | Purpose | Dependencies |
|---|---|---|
release-image | Native per-platform image build and push | none |
release-manifest | Merge platform digests into multi-arch manifest | release-image |
release-artifacts | Create GitHub Release with install manifest | release-manifest |
Trigger
on:
push:
tags: ["v*"]The workflow fires when a tag starting with v is pushed. Tags must follow semantic versioning: v<major>.<minor>.<patch> (e.g., v0.1.0, v1.2.3).
Permissions
| Permission | Scope | Purpose |
|---|---|---|
contents: write | release-artifacts | Create GitHub Releases |
packages: write | release-image, release-manifest | Push images to GHCR |
contents: read | release-image | Checkout code |
Jobs
release-image
Uses a matrix strategy with native runners for each platform to avoid slow QEMU emulation:
| Platform | Runner |
|---|---|
linux/amd64 | ubuntu-latest |
linux/arm64 | ubuntu-24.04-arm |
Each matrix job builds the image natively for its platform and pushes a single-platform image by digest to GHCR. The digest is exported as an artifact for the merge step.
Build args inject version metadata into the binary via ldflags:
| Build Arg | Value | Description |
|---|---|---|
VERSION | Tag name | e.g., v1.2.3 |
GIT_COMMIT | Full commit SHA | 40-character hex string |
BUILD_DATE | UTC timestamp | RFC 3339 format |
release-manifest
Downloads the per-platform digests from the release-image matrix and creates a multi-arch manifest list using docker buildx imagetools create. The manifest is tagged with semver tags generated by docker/metadata-action@v5:
| Tag Pattern | Example (tag v1.2.3) | Description |
|---|---|---|
| 1.2.3 | Full semver (without v) |
. | 1.2 | Minor version float tag |
| 1 | Major version float tag |
The major-only tag (1) is disabled for v0.x releases to avoid misleading stability expectations from a 0 tag.
release-artifacts
Runs after release-image succeeds. This job:
Generates
install.yamlusingmake build-installerwith the release image reference (ghcr.io/c5c3/memcached-operator:v1.2.3). This file contains all Kubernetes manifests (CRDs, RBAC, Deployment, webhooks, cert-manager resources) in a single file.Copies the CRD manifest (
memcached.c5c3.io_memcacheds.yaml) for users who want to install only the CRD without the operator.Generates a changelog using git-cliff with the
cliff.tomlconfiguration at the repository root. git-cliff parses conventional commits and groups them by type (Features, Bug Fixes, Testing, etc.). Planning commits (plan(...)) are automatically excluded.Creates a GitHub Release using
softprops/action-gh-release@v2with:- git-cliff generated changelog grouped by commit type
- Container image reference and install instructions
- Attached artifacts:
install.yaml,memcached.c5c3.io_memcacheds.yaml
Release Artifacts
Each GitHub Release includes the following downloadable files:
| Artifact | Description |
|---|---|
install.yaml | Consolidated Kustomize manifest |
memcached.c5c3.io_memcacheds.yaml | Standalone CRD manifest |
install.yaml
A single-file manifest that installs the complete operator stack:
- CustomResourceDefinition (
memcacheds.memcached.c5c3.io) - Namespace (
memcached-operator-system) - ServiceAccount, ClusterRole, ClusterRoleBinding (RBAC)
- Deployment (controller manager with the release image)
- Webhook configurations (mutating + validating)
- cert-manager Certificate and Issuer
Install with:
kubectl apply -f https://github.com/c5c3/memcached-operator/releases/download/v1.2.3/install.yamlCRD manifest
For environments where you manage the operator deployment separately:
kubectl apply -f https://github.com/c5c3/memcached-operator/releases/download/v1.2.3/memcached.c5c3.io_memcacheds.yamlCreating a Release
To create a new release:
# Ensure you are on the main branch with CI passing
git checkout main
git pull
# Create and push an annotated tag
git tag -a v1.2.3 -m "Release v1.2.3"
git push origin v1.2.3The release workflow runs automatically and creates:
- Container images at
ghcr.io/c5c3/memcached-operator:1.2.3 - A GitHub Release at
https://github.com/c5c3/memcached-operator/releases/tag/v1.2.3
Image Tagging Summary
| Source | Tags | Registry |
|---|---|---|
Push to main | latest, <short-sha> | GHCR |
Tag v0.2.0 | 0.2.0, 0.2 | GHCR |
Tag v1.2.3 | 1.2.3, 1.2, 1 | GHCR |
All images are multi-architecture manifests (linux/amd64, linux/arm64).