From 1b4600d290b17b17c5f270dc88a27fbf2c354780 Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Wed, 19 Nov 2025 16:16:33 +0100 Subject: [PATCH 1/2] Add release automation --- .tool-versions | 1 + release-automation/bump-version.sh | 36 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .tool-versions create mode 100755 release-automation/bump-version.sh diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 00000000..3515b8bc --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 24.4.1 diff --git a/release-automation/bump-version.sh b/release-automation/bump-version.sh new file mode 100755 index 00000000..71f8d7f0 --- /dev/null +++ b/release-automation/bump-version.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -e + +# Usage: ./bump-version.sh +VERSION="$1" + +if [ -z "$VERSION" ]; then + echo "Usage: $0 " + exit 1 +fi + +# Create release branch +BRANCH_NAME="release-$VERSION" +git checkout -b "$BRANCH_NAME" + +echo "Enabling corepack and installing dependencies..." +corepack enable +yarn install + +# Update root package.json +if [ -f package.json ]; then + echo "Enabling corepack..." + corepack enable + 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" From 072a5139ca4afa372f4f0fee612d40905c696954 Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:41:42 +0100 Subject: [PATCH 2/2] Update Node.js version to 24.4.1 and enhance bump-version script for better version validation --- .tool-versions | 2 +- release-automation/bump-version.sh | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.tool-versions b/.tool-versions index 3515b8bc..7caf03a0 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -nodejs 24.4.1 +nodejs 18 diff --git a/release-automation/bump-version.sh b/release-automation/bump-version.sh index 71f8d7f0..35ce589f 100755 --- a/release-automation/bump-version.sh +++ b/release-automation/bump-version.sh @@ -1,7 +1,17 @@ #!/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 @@ -9,18 +19,21 @@ if [ -z "$VERSION" ]; then 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" -echo "Enabling corepack and installing dependencies..." -corepack enable -yarn install - # 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