Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions .github/workflows/release-creator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ jobs:
run: |
current_version=$MY_VAR
current_version=(${current_version#v}) # remove 'v' prefix from $current_version"

IFS='.' read -r -a version_parts <<< "$current_version"

if "${{ inputs.version == 'major' }}"; then
# major version bump up
version_parts[0]=$(expr ${version_parts[0]} + 1)
new_version="${version_parts[0]}.0.0"
fi

if "${{ inputs.version == 'minor' }}"; then
# minor version bump up
version_parts[1]=$(expr ${version_parts[1]} + 1)
new_version="${version_parts[0]}.${version_parts[1]}.0"
fi

if "${{ inputs.version == 'patch' }}"; then
# patch version bump up
version_parts[2]=$(expr ${version_parts[2]} + 1)
Expand Down Expand Up @@ -82,15 +82,15 @@ jobs:

- name: Download binary
uses: actions/download-artifact@v4.2.1

# This is required to check if the binary exists and update its name to the release.
- run: |
FILE="./cert-csi-linux-amd64/cert-csi-linux-amd64"
if [ -d "repctl-linux-amd64" ]; then
FILE="./repctl-linux-amd64/repctl-linux-amd64"
fi
echo "File name: $FILE"
echo "FILE_NAME=$FILE" >> $GITHUB_ENV
- run: |
FILE="./cert-csi-linux-amd64/cert-csi-linux-amd64"
if [ -d "repctl-linux-amd64" ]; then
FILE="./repctl-linux-amd64/repctl-linux-amd64"
fi
echo "File name: $FILE"
echo "FILE_NAME=$FILE" >> $GITHUB_ENV
shell: bash

- name: Create Release
Expand All @@ -112,5 +112,12 @@ jobs:
env:
REL_VERSION: ${{ env.REL_VERSION }}
run: |
git checkout -b release/$REL_VERSION
git push origin release/$REL_VERSION
branch_name="release/$REL_VERSION"
git fetch origin
if git ls-remote --heads origin $branch_name | grep $branch_name; then
Comment thread
ChristianAtDell marked this conversation as resolved.
echo "Branch name $branch_name already exists. Skipping branch creation."
git checkout $branch_name
else
git checkout -b $branch_name
git push origin $branch_name
fi