Skip to content

How to Release

Dimitri Koshkin edited this page Feb 10, 2023 · 24 revisions

How to Release

We use the convention ${UPSTREAM_VERSION}-d2iq.${DOWNSTREAM_VERSION}. For example, if latest tagged upstream version is v1.1.3, our first release with that version is v1.1.3-d2iq.0, our second release is v1.1.3-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.2.2
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 1db0dc1e6ac30d00e6747e2a13272dd1c9fcfdc6 95b0018eb123735c6870a3926b90569f82c552fa c8b156dd7ecd20c3dab715fc53781535d1c2aabb 1397bf1a0090038bdbb0e988a48786c66c12c992 cfe22f34efc2b054e95a312bf0fc0a8fb1fbd879 af6751db644ce532010d76d59926e43b66b266a0 6ecc37b6ee4927048edb70ccba33493884014378 d147f8d79bf6d4e5d7d3225003534aa9fb8f750b ce53a43d8a790f86aaece629133b25d958f7e739 5bd09bb1d691ca024457fa356a93bcda26b7df19 afc5bfe642fbf10ec55e87890e7b66178841084c 26eb0491e07f462e3277762c6022eeeeb4740720 279da8b0e87d319707deba34819107b8f584e99c 9ce4f0774ac96c09ffc499af7123febad772fd32 8cd1ceef56ec27fd873abeeb633bd7096a9e5362 292b58c600f70692058b38cd56ff80aa4da52aef

# 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

# 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

# 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/*
Clone this wiki locally