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..ac4ed57 100644 --- a/scripts.py +++ b/scripts.py @@ -85,9 +85,13 @@ 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 \