Skip to content

Commit

Permalink
Revert "Update ecctl release process for patch versions (#671)" (#674)
Browse files Browse the repository at this point in the history
This reverts commit 59f119d.
  • Loading branch information
claudia-correia authored Nov 18, 2024
1 parent 59f119d commit c68e772
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 3 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: release-branch

on:
workflow_dispatch:
push:
tags:
- '*.*.*'

permissions:
contents: write

jobs:
branch-out:
name: Create a github branch
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get the branch version
id: get_branch
run: |
BRANCH=${GITHUB_REF/refs\/tags\//}
if ${{github.event_name == 'workflow_dispatch'}}; then
BRANCH=$(git describe --abbrev=0 --tags)
fi
echo "BRANCH=$(echo ${BRANCH} | cut -d '.' -f1-2 | tr -d 'v')" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
id: go

- name: Bump patch version
run: make patch

- name: Create new branch and commit changes to the minor branch
uses: EndBug/add-and-commit@v9
with:
default_author: user_info
message: 'Update patch version'
new_branch: ${{ steps.get_branch.outputs.BRANCH }}
author_name: elasticcloudclients
author_email: [email protected]

bump-minor-version:
name: Bump main version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_EXTRA }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
id: go

- name: Bump main version
run: make minor; git diff

- name: Commit changes to main
uses: EndBug/add-and-commit@v9
with:
default_author: user_info
message: 'Update minor version'
branch: master
author_name: elasticcloudclients
author_email: [email protected]
8 changes: 5 additions & 3 deletions developer_docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ Releasing a new version of the binary implies that there have been changes in th

Unless this is a patch release, make sure a `cloud-sdk-go` release with the same version has been made. Once this is done, the `cloud-sdk-go` dependency should be updated to that version. To update the cloud-sdk-go dependency, please update the version in `go.mod`.

### Update the version
### Make sure the version has been updated

**Since the version updates are now automated via github actions, this is just a double check**

Since the source has changed, we need to update the current committed version to a higher version so that the release is published.

Expand All @@ -34,14 +36,14 @@ SHELL := /bin/bash
export VERSION ?= v1.0.0
```

Say we want to perform a minor version release (i.e. no breaking changes and only new features and bug fixes are being included); in which case we'll update the _MINOR_ part of the version, this can be done with the `make minor` target.
Say we want to perform a minor version release (i.e. no breaking changes and only new features and bug fixes are being included); in which case we'll update the _MINOR_ part of the version, this can be done with the `make minor` target, but it should have been updated automatically via GitHub actions.

```Makefile
SHELL := /bin/bash
export VERSION ?= v1.1.0
```

If a patch version needs to be released, the VERSION variable can be bumped with the `make patch` target.
If a patch version needs to be released, the release will be done from the minor branch. For example, if we want to release `v1.5.1`, we will check out the `1.5` branch and perform any changes in that branch. The VERSION variable in the Makefile should already be up to date, but in case it's not, it can be bumped with the `make patch` target.

### Generating a changelog for the new version

Expand Down

0 comments on commit c68e772

Please sign in to comment.