Skip to content

How to Release

Dimitri Koshkin edited this page Jun 27, 2023 · 24 revisions

How to Release

We use the convention ${UPSTREAM_VERSION}-d2iq.${DOWNSTREAM_VERSION}. For example, if latest tagged upstream version is v1.4.1, our first release with that version is v1.4.1-d2iq.0, our second release is v1.4.1-d2iq.1, and so on.

We should keep up to date with upstream. If there is a new upstream version, we should pull in the changes.

Prepare Environment

# Fetch all tags from upstream
git fetch upstream 'refs/tags/*:refs/tags/*'

# Use the upstream tag,e.g. v1.4.1
export UPSTREAM_VERSION=

# Start with 0, and increment for subsequent releases that use the same upstream patch version.
export DOWNSTREAM_RELEASE_VERSION=

export VERSION=${UPSTREAM_VERSION}-d2iq.${DOWNSTREAM_RELEASE_VERSION}
export RELEASE_TAG=${VERSION}

# Override upstream CAPI controller manager container image defaults
export REGISTRY=docker.io/mesosphere
export PROD_REGISTRY=$REGISTRY
export TAG=$VERSION

# Override upstream CAPD controller manager container image defaults
export STAGING_REGISTRY=$REGISTRY

Tag and push

# NOTE origin is assumed to be the remote that points to https://github.com/mesosphere/cluster-api

# checkout the branch
git checkout -b d2iq/release-${UPSTREAM_VERSION#v} ${UPSTREAM_VERSION}

# cherry-pick d2iq changes
git cherry-pick 7f071f79f5042b9bcc7bc431c8aa9395901c7963 43020329fb45a9e158ee40d9ac68fad9efe9fc89 ec8b4fd5e3ad03800606ad528d4b1e7564b59438 2139dfe79486bf0acd3a2c685811593947aaa51e 14e8e522efa8399105ad814620609fa0df0cd972 6360fa77cdba17f862e4cc18e3980e805cf62138 86c6fe522c804f09d9c3754e426bceb83a295834

# push release branch
git push origin d2iq/release-${UPSTREAM_VERSION#v}

# tag and push the new release
git tag --sign ${VERSION} -m "${VERSION}"
git push origin ${VERSION}

# tag and push the new test release (for CAPD)
git tag --sign test/${VERSION} -m "${VERSION}"
git push origin test/${VERSION}

Build and push container images (for manual release only)

# NOTE Each arch requires its own registry. So far, we only have registries for amd64 and arm64.
# Build the CAPI and CAPD images for every arch
make ALL_ARCH="amd64 arm64" docker-build-all docker-capd-build-all

# Push the CAPI and CAPD images for every arch
make ALL_ARCH="amd64 arm64" docker-push-all docker-capd-push-all

Create the GitHub Release (for manual release only)

# Build the CAPI and CAPD release artifacts
make release

# Create the GitHub release and push the artifacts
export GITHUB_TOKEN=<>
gh release create --repo mesosphere/cluster-api --title ${VERSION} --notes "${VERSION}" ${VERSION}
gh release upload --repo mesosphere/cluster-api ${VERSION} out/*