diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c85048d..bb162d6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,12 +4,12 @@ name: Build and Release on: push: tags: - - "[0-9]+.[0-9]+.[0-9]+" - - "[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" - - "[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" - - "[0-9]+.[0-9]+.[0-9]+a[0-9]+" - - "[0-9]+.[0-9]+.[0-9]+b[0-9]+" - - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+a[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+b[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+" workflow_dispatch: # Allow manual triggering permissions: @@ -134,9 +134,11 @@ jobs: - name: Extract version from tag id: get_version run: | - VERSION=${GITHUB_REF#refs/tags/} + TAG=${GITHUB_REF#refs/tags/} + # Strip 'v' prefix for version number (PyPI doesn't use it) + VERSION=${TAG#v} echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + echo "tag=$TAG" >> $GITHUB_OUTPUT - name: Generate release notes id: release_notes @@ -196,9 +198,11 @@ jobs: - name: Extract version from tag id: get_version run: | - VERSION=${GITHUB_REF#refs/tags/} + TAG=${GITHUB_REF#refs/tags/} + # Strip 'v' prefix for version number (PyPI doesn't use it) + VERSION=${TAG#v} echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + echo "tag=$TAG" >> $GITHUB_OUTPUT - name: Success notification run: | diff --git a/helm_sdkpy/actions.py b/helm_sdkpy/actions.py index 12adc8d..c72b011 100644 --- a/helm_sdkpy/actions.py +++ b/helm_sdkpy/actions.py @@ -99,7 +99,9 @@ def __init__( options_json = json.dumps(options) options_cstr = ffi.new("char[]", options_json.encode("utf-8")) - result = self._lib.helm_sdkpy_config_create(ns_cstr, kc_cstr, kctx_cstr, options_cstr, self._handle) + result = self._lib.helm_sdkpy_config_create( + ns_cstr, kc_cstr, kctx_cstr, options_cstr, self._handle + ) check_error(result) self._handle_value = self._handle[0] @@ -120,7 +122,7 @@ def __exit__(self, exc_type, exc_val, exc_tb): @classmethod def from_service_account( - cls, + cls, namespace: str = "default", plain_http: bool = False, insecure_skip_tls_verify: bool = False, @@ -156,8 +158,8 @@ def from_service_account( ... ) """ return cls( - namespace=namespace, - kubeconfig=None, + namespace=namespace, + kubeconfig=None, kubecontext=None, plain_http=plain_http, insecure_skip_tls_verify=insecure_skip_tls_verify, diff --git a/justfile b/justfile index 13b9120..52ce17b 100644 --- a/justfile +++ b/justfile @@ -122,4 +122,56 @@ docs-help: @echo " docs-build - Build for production (includes API docs generation)" @echo " docs-generate-api - Generate API docs from SDK source" @echo " docs-serve - Serve built site" - @echo " docs-clean - Clean build artifacts" \ No newline at end of file + @echo " docs-clean - Clean build artifacts" + +# Release helm-sdkpy with a new version +# Usage: just release 0.0.21 +[group("release")] +release version: + #!/usr/bin/env bash + set -euo pipefail + + echo "🔖 Releasing helm-sdkpy version {{version}}..." + + # Create release branch + echo "🌿 Creating release branch release/{{version}}..." + git checkout -b "release/{{version}}" + + # Bump pyproject.toml version + echo "📝 Updating pyproject.toml..." + sed -i 's/^version = ".*"/version = "{{version}}"/' pyproject.toml + + # Update docusaurus version.yml if it exists + if [ -f "docusaurus/data/version.yml" ]; then + echo "📝 Updating docusaurus/data/version.yml..." + sed -i 's/^version: .*/version: "{{version}}"/' docusaurus/data/version.yml + fi + + # Regenerate lock file + echo "🔒 Regenerating uv.lock..." + uv lock --no-cache + + # Commit changes + echo "📦 Committing version bump..." + git add pyproject.toml uv.lock + if [ -f "docusaurus/data/version.yml" ]; then + git add docusaurus/data/version.yml + fi + git commit -m "chore: bump version to {{version}}" + + # Push release branch + echo "🚀 Pushing release branch..." + git push origin "release/{{version}}" + sleep 1 + + # Create tag + echo "🏷️ Creating tag..." + git tag -a "v{{version}}" -m "helm-sdkpy release version {{version}}" + + # Push tag + echo "🚀 Pushing tag..." + git push origin "v{{version}}" + + echo "✅ Released helm-sdkpy version {{version}}" + echo " Branch: release/{{version}}" + echo " Tag: v{{version}}" \ No newline at end of file