Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created promote-release script #55

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
38 changes: 38 additions & 0 deletions bin/promote_release
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

function print_usage {
echo "Usage: promote_release <version_number>"
echo ""
echo "Arguments:"
echo " <version_number> The version number of the release to promote (semver format)"
}

# Validate received parameters
if [ $# -eq 0 ]; then
printf "[ERROR] No arguments were provided\n"
print_usage
exit 1
fi

RC_VERSION=$1

# Validate version format: check if it's semver compliant
if ! [[ "$RC_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: Version number '$RC_VERSION' is not in semver format."
exit 1
fi

echo "Preparing to promote release version: $RC_VERSION"

# Bump version
bash "$(dirname "$(realpath "$0")")/version_bump" $RC_VERSION || exit 1

# Get current branch, tag, commit & push
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
git tag $RC_VERSION || { echo "Error: Failed to create tag."; exit 1; }
ArielDemarco marked this conversation as resolved.
Show resolved Hide resolved

git add EmbraceIO.podspec \
Sources/EmbraceCommonInternal/EmbraceMeta.swift

git commit -m "Bumps version to '$RC_VERSION'"
git push origin $CURRENT_BRANCH --tags
2 changes: 1 addition & 1 deletion bin/version_bump
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ create_meta_file() {
// Copyright © 2024 Embrace Mobile, Inc. All rights reserved.
//

// This file is automatically generated by the "${BASH_SOURCE[0]}" script
// This file is automatically generated by the '$(basename "$0")' script
// Do not edit this file manually

public class EmbraceMeta {
Expand Down
Loading