Skip to content

Release branch script #510

Closed
Closed
@fhennig

Description

@fhennig

There is a version_bump.sh script, but it is outdated. Create a script that gets given a release (with full major.minor.patch) and then

  • check if on main branch, working directory empty and up-to-date
  • checkout new branch "release/major.minor"
  • update antora.yaml file:
    • set the 'version' key
    • set the 'prerelease' key to false
    • set the 'crd-docs-version' key
  • show a diff and ask for confirmation
  • commit changes
  • push the branch

This does the checks (probably):

#!/bin/bash

# Check if on main branch
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$current_branch" != "main" ]; then
    echo "Not on the main branch. Please switch to the main branch."
    exit 1
fi

# Check if the branch is up to date with the origin
git fetch
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/main)" ]; then
    echo "Your branch is not up to date with the origin main branch. Please pull the latest changes."
    exit 1
fi

# Check if the working directory is clean
if [ -n "$(git status --porcelain)" ]; then
    echo "Working directory is not clean. Please commit or stash your changes."
    exit 1
fi

echo "All checks passed. You are on the main branch, up to date with the origin, and the working directory is clean."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions