Skip to content

Create Release Branch #100

Create Release Branch

Create Release Branch #100

# Create Release Branch
# TODO after GitHub add permission for action-bot to commit to the protected branches - please merge release-* workflow into one
name: Create Release Branch
on:
workflow_dispatch:
inputs:
version:
description: "Release version:"
required: true
jobs:
create-release-branch:
name: Create Release
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version }}
TAG: v${{ github.event.inputs.version }}
GITHUB_REPO: mongodb/mongodb-atlas-kubernetes
DOCKER_RELEASE_REPO: mongodb/mongodb-atlas-kubernetes-operator
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0 #required for tags
- name: Create deploy configurations
uses: ./.github/actions/gen-install-scripts
with:
IMAGE_URL: ${{ env.DOCKER_RELEASE_REPO }}:${{ env.VERSION }}
VERSION: ${{ env.VERSION }}
ENV: prod
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "${{ github.workspace }}/go.mod"
cache: false
- name: Download dependencies
run: |
go mod download
- name: Configure Git
run: |
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ env.GITHUB_REPO }}.git
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Create branch and push it
run: |
make check-major-version
BRANCH="release/${VERSION}"
git checkout -b $BRANCH
git add -f ./deploy ./bundle bundle.Dockerfile
git commit -m "Release ${VERSION}"
git reset --hard
git push --set-upstream origin $BRANCH
- name: Create PR
uses: ./.github/actions/create-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
REVIEWERS: igor-karpukhin,helderjs,josvazg,roothorp