From 5bd7ac562efbc7aafab823aa274de2f371171856 Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:03:03 +0100 Subject: [PATCH 1/2] Add release automation --- .tool-versions | 1 + release-automation/bump-version.sh | 42 ++++++++++++++++++++++++++++++ scripts.py | 6 ++++- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100755 release-automation/bump-version.sh diff --git a/.tool-versions b/.tool-versions index c9198ce..d0dbca6 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,3 @@ python 3.13.5 uv 0.8.12 +protoc 33.0 diff --git a/release-automation/bump-version.sh b/release-automation/bump-version.sh new file mode 100755 index 0000000..9f03313 --- /dev/null +++ b/release-automation/bump-version.sh @@ -0,0 +1,42 @@ +#!/bin/bash +set -e + +# Usage: ./bump-version.sh +VERSION="$1" + +if [ -z "$VERSION" ]; then + echo "Usage: $0 " + exit 1 +fi + +BRANCH_NAME="release-$VERSION" +git checkout -b "$BRANCH_NAME" + +echo "Installing asdf dependencies..." +# add plugins from .tool-versions +while read -r line; do + PLUGIN_NAME=$(echo "$line" | awk '{print $1}') + if ! asdf plugin list | grep -q "^$PLUGIN_NAME$"; then + echo "Adding asdf plugin: $PLUGIN_NAME" + asdf plugin add "$PLUGIN_NAME" + else + echo "asdf plugin $PLUGIN_NAME already added" + fi +done < .tool-versions + +asdf install + +uv version "$VERSION" +uv run ./compile_proto.sh + +# Update OpenAPI client +curl -H "Authorization: token $GH_TOKEN" \ + -H "Accept: application/vnd.github.v3.raw" \ + -L "https://raw.githubusercontent.com/fishjam-cloud/fishjam/main/openapi.yaml" \ + -o openapi.yaml + +uv run update_client ./openapi.yaml +rm openapi.yaml + +echo "✅ Version bump complete for $VERSION" +echo "BRANCH_NAME:$BRANCH_NAME" diff --git a/scripts.py b/scripts.py index 61220a0..c7c5a57 100644 --- a/scripts.py +++ b/scripts.py @@ -84,10 +84,14 @@ def generate_docs(): def update_client(): if len(sys.argv) < 2: raise RuntimeError("Missing fishjam openapi.yaml raw url positional argument") + + url_or_path = sys.argv[1] + is_url = url_or_path.startswith("http://") or url_or_path.startswith("https://") + file_arg = f"--url {url_or_path}" if is_url else f"--path {url_or_path}" check_exit_code( f"openapi-python-client generate \ - --url {sys.argv[1]} \ + {file_arg} \ --config openapi-python-client-config.yaml \ --meta=none \ --overwrite \ From 3a079470812222a30ce65dffa8230c0732c8bc11 Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Thu, 27 Nov 2025 12:03:03 +0100 Subject: [PATCH 2/2] Format --- scripts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts.py b/scripts.py index c7c5a57..ac4ed57 100644 --- a/scripts.py +++ b/scripts.py @@ -84,7 +84,7 @@ def generate_docs(): def update_client(): if len(sys.argv) < 2: raise RuntimeError("Missing fishjam openapi.yaml raw url positional argument") - + url_or_path = sys.argv[1] is_url = url_or_path.startswith("http://") or url_or_path.startswith("https://") file_arg = f"--url {url_or_path}" if is_url else f"--path {url_or_path}"