Skip to content

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:

  1. Multi-arch container image pushed to GHCR with semver tags.
  2. GitHub Release with changelog and downloadable install artifacts.
JobPurposeDependencies
release-imageNative per-platform image build and pushnone
release-manifestMerge platform digests into multi-arch manifestrelease-image
release-artifactsCreate GitHub Release with install manifestrelease-manifest

Trigger

yaml
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

PermissionScopePurpose
contents: writerelease-artifactsCreate GitHub Releases
packages: writerelease-image, release-manifestPush images to GHCR
contents: readrelease-imageCheckout code

Jobs

release-image

Uses a matrix strategy with native runners for each platform to avoid slow QEMU emulation:

PlatformRunner
linux/amd64ubuntu-latest
linux/arm64ubuntu-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 ArgValueDescription
VERSIONTag namee.g., v1.2.3
GIT_COMMITFull commit SHA40-character hex string
BUILD_DATEUTC timestampRFC 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 PatternExample (tag v1.2.3)Description
1.2.3Full semver (without v)
.1.2Minor version float tag
1Major 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:

  1. Generates install.yaml using make build-installer with 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.

  2. Copies the CRD manifest (memcached.c5c3.io_memcacheds.yaml) for users who want to install only the CRD without the operator.

  3. Generates a changelog using git-cliff with the cliff.toml configuration 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.

  4. Creates a GitHub Release using softprops/action-gh-release@v2 with:

    • 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:

ArtifactDescription
install.yamlConsolidated Kustomize manifest
memcached.c5c3.io_memcacheds.yamlStandalone 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:

bash
kubectl apply -f https://github.com/c5c3/memcached-operator/releases/download/v1.2.3/install.yaml

CRD manifest

For environments where you manage the operator deployment separately:

bash
kubectl apply -f https://github.com/c5c3/memcached-operator/releases/download/v1.2.3/memcached.c5c3.io_memcacheds.yaml

Creating a Release

To create a new release:

bash
# 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.3

The release workflow runs automatically and creates:

  1. Container images at ghcr.io/c5c3/memcached-operator:1.2.3
  2. A GitHub Release at https://github.com/c5c3/memcached-operator/releases/tag/v1.2.3

Image Tagging Summary

SourceTagsRegistry
Push to mainlatest, <short-sha>GHCR
Tag v0.2.00.2.0, 0.2GHCR
Tag v1.2.31.2.3, 1.2, 1GHCR

All images are multi-architecture manifests (linux/amd64, linux/arm64).