diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 00000000..7caf03a0 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 18 diff --git a/release-automation/bump-version.sh b/release-automation/bump-version.sh new file mode 100755 index 00000000..35ce589f --- /dev/null +++ b/release-automation/bump-version.sh @@ -0,0 +1,49 @@ +#!/bin/bash +set -e + +# NOTE: +# This script prepares a release by creating a `release-` branch +# and updating package versions (root `package.json` and the +# `@fishjam-cloud/react-native-client` workspace). It does NOT commit or +# push the changes to the remote repository. Committing and pushing (and any +# additional CI/workflow steps) are expected to be handled by the caller or +# the surrounding release automation workflow that invokes this script. +# This will be called by the release workflow in @fishjam-cloud/release-automation. +# +# Usage: ./bump-version.sh + +VERSION="$1" + +if [ -z "$VERSION" ]; then + echo "Usage: $0 " + exit 1 +fi + +# Validate semantic version format (X.Y.Z) +if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Version must be in format X.Y.Z" + exit 1 +fi + +# Create release branch +BRANCH_NAME="release-$VERSION" +git checkout -b "$BRANCH_NAME" + +# Update root package.json +if [ -f package.json ]; then + echo "Enabling corepack..." + corepack enable + corepack yarn install + corepack yarn version "$VERSION" + echo "Updated root package.json to $VERSION" +else + echo "Root package.json not found!" + exit 1 +fi + +# Update react-native-client package +corepack yarn workspace @fishjam-cloud/react-native-client version "$VERSION" +echo "Updated react-native-client to $VERSION" + +echo "✅ Version bump complete for $VERSION" +echo "BRANCH_NAME:$BRANCH_NAME"