Skip to main content
Version: 0.4

Capact release process

This document describes Capact release process. Currently, it consists of a set of manual steps, however in future it will be automated.

Prerequisites

  • Make

  • Git

  • Go at least 1.16

  • Docker

  • UPX tool installed

  • GoReleaser CLI installed

    NOTE: Use the commit SHA, as we use the no_unique_dist_dir feature, which was not yet released.

    go install github.com/goreleaser/goreleaser@b53dbb89d02aa3673782f3d063d7d5039446baac

Steps

Export environmental variables

Export environmental variable with the new Capact version:

Use Semantic Versioning 2.0.0 to specify the next Capact release.

export RELEASE_VERSION={major}.{minor}.{patch}
export RELEASE_MAJOR_MINOR_VERSION={major}.{minor}

# do not change the following line:
export RELEASE_BRANCH=release-${RELEASE_MAJOR_MINOR_VERSION}

For example, in case of the 0.3.0 release, it would be:

export RELEASE_VERSION=0.3.0 
export RELEASE_MAJOR_MINOR=0.3

# do not change the following line:
export RELEASE_BRANCH=release-${RELEASE_MAJOR_MINOR_VERSION}

Create a pre-release pull request

  1. Checkout the destination branch for the pull request.

    • For major and minor release versions, set the destination branch to main.
    • For patch releases, set the destination to corresponding release branch. For example, for 0.3.1 release, checkout the release-0.3 branch.
    git checkout {destination-branch}
  2. Create and checkout new branch:

    git checkout -b prepare-${RELEASE_VERSION}
  3. Modify .github/workflows/branch-build.yaml and append new branch to on.push.branches:

    branches:
    - "main"
    - "release-0.2"
    # (...)
    - "release-{major}.{minor}" # append the new release branch item
  4. Change versions of all Helm charts:

    DEPLOY_DIR=deploy/kubernetes/charts
    for d in ${DEPLOY_DIR}/*/ ; do
    sed -i.bak "s/^version: .*/version: ${RELEASE_VERSION}/g" "${d}/Chart.yaml"
    done
  5. Change CLI version:

    sed -i.bak "s/Version = .*/Version = \"${RELEASE_VERSION}\"/g" "internal/cli/info.go"
  6. Commit the changes and push the branch to origin.

    git add .
    git commit -m "Prepare ${RELEASE_VERSION} release"
    git push -u origin prepare-${RELEASE_VERSION}
  7. Create the pull request from the branch.

    • In the pull request description, write the GitHub release notes that will be posted with the release to review.
    • As the pull request target branch, pick the proper destination branch from the first step of this section.
  8. Merge the pull request.

Create release branch

If you release major or minor version, create a dedicated release branch.

  1. Checkout the destination branch and pull the latest changes:

    git checkout {destination_branch}
    git pull
  2. Create a new branch:

    git checkout -b ${RELEASE_BRANCH}

Release Helm charts

  1. Get the latest commit short hash on the destination branch:

    export CAPACT_IMAGE_TAG=$(git rev-parse --short HEAD | sed 's/.$//')

    NOTE: It will be used as a Docker image tag for the release Helm charts. Make sure all the component images with this tag have been built on CI.

  2. Replace default tag for Capact chart:

    sed -i.bak "s/overrideTag: \"latest\"/overrideTag: \"${CAPACT_IMAGE_TAG}\"/g" "deploy/kubernetes/charts/capact/values.yaml"
  3. Replace Populator target branch from main to the release branch:

    sed -i.bak "s/branch: main/branch: ${RELEASE_BRANCH}/g" "deploy/kubernetes/charts/capact/charts/hub-public/values.yaml"
  4. Review and commit the changes:

    git add .
    git commit -m "Set fixed Capact image tag and Populator source branch"
  5. Release Helm charts:

    make release-charts

Create new git tag and publish binaries

  1. Create new tag and push it and release branch to origin:

    NOTE: Git tag is in a form of SemVer version with v prefix, such as v0.3.0.

    git tag v${RELEASE_VERSION} HEAD
  2. Review the changes you've made and push the release branch with tag to origin:

    git push -u origin ${RELEASE_BRANCH}
    git push origin v${RELEASE_VERSION}
  3. Release tools binaries:

    NOTE: GoReleaser uses the git tag as binaries version.

    make release-binaries

Create GitHub release

  1. Navigate to the New GitHub release page.
  2. Copy the release notes from the pull request created in the Create a pre-release pull request section.
  3. Create the new GitHub release with the copied notes.

Release documentation

If you release a new major or minor Capact version, follow these steps:

  1. Clone the website repository locally.

  2. Follow instructions from the README.md document to fulfill all prerequisites.

  3. Create and checkout new branch:

    git checkout -b prepare-${RELEASE_MAJOR_MINOR_VERSION}
  4. Synchronize Capact CLI documentation according to the Synchronize CLI documentation section.

  5. Run the following command:

    npm run docusaurus docs:version ${RELEASE_MAJOR_MINOR_VERSION}
  6. Update redirects in the redirects.js file to make sure we point to proper documents for all documentation versions:

    For example, for 0.3 release, change the line:

    ...generateDocsRedirectsForVersion("0.2", ""), // redirect from 0.2 to latest

    to:

    ...generateDocsRedirectsForVersion("0.2"),
    ...generateDocsRedirectsForVersion("0.3", ""), // redirect from 0.3 to latest
  7. Update stable release version for Capact binaries:

    sed -i.bak "s/capactio-binaries\/v\([0-9]*\.[0-9]*\.[0-9]*\)/capactio-binaries\/v${RELEASE_VERSION}/g" ./docs/cli/getting-started.mdx
    sed -i.bak "s/capact-cli:v\([0-9]*\.[0-9]*\.[0-9]*\)/capact-cli:v${RELEASE_VERSION}/g" ./docs/cli/getting-started.mdx
  8. Commit and push the changes

    git add .
    git commit -m "Release ${RELEASE_MAJOR_MINOR_VERSION} documentation"
    git push -u origin prepare-${RELEASE_MAJOR_MINOR_VERSION}
  9. Create a new pull request for the website repository.

  10. Merge the pull request.

To read more about documentation versioning, see the Versioning page on the Docusaurus website.