From 52451a0cd773153c74c3ed8e22fc811a73a31e3e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Jul 2026 12:55:24 +0000 Subject: [PATCH 1/3] Release v1.1: bump manifest version and add release workflow Bump the integration version to 1.1 and add a tag-triggered release workflow that publishes a GitHub Release (consumed by HACS) using the Actions contents:write token. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Ro82CB9Y3Sdq8b7Suk9Kys --- .github/workflows/release.yml | 24 +++++++++++++++++++ custom_components/smart_climate/manifest.json | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..799404e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release + +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Create GitHub release + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "${GITHUB_REF_NAME}" \ + --title "${GITHUB_REF_NAME}" \ + --generate-notes \ + --verify-tag diff --git a/custom_components/smart_climate/manifest.json b/custom_components/smart_climate/manifest.json index 81202f3..1fc5f5a 100644 --- a/custom_components/smart_climate/manifest.json +++ b/custom_components/smart_climate/manifest.json @@ -1,7 +1,7 @@ { "domain": "smart_climate", "name": "Smart Climate Controller", - "version": "1.0.0", + "version": "1.1", "documentation": "https://github.com/JansenDevelopment/Smart-Climate-Controller", "dependencies": [], "codeowners": ["@JansenDevelopment"], From 5e49d22482c9a804c323291ec02c652cdbc6dddf Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Jul 2026 12:57:08 +0000 Subject: [PATCH 2/3] Make release workflow self-bootstrap the tag and GitHub Release Derive the tag from manifest.json version on branch push (or use the pushed tag), then create the tag and GitHub Release from within Actions. Idempotent: skips tag/release creation when they already exist. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Ro82CB9Y3Sdq8b7Suk9Kys --- .github/workflows/release.yml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 799404e..0b6d6a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,8 +2,11 @@ name: Release on: push: + branches: + - "claude/release-latest-commit-**" tags: - "v*" + workflow_dispatch: jobs: release: @@ -14,11 +17,31 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Create GitHub release + - name: Resolve tag and publish release env: GH_TOKEN: ${{ github.token }} run: | - gh release create "${GITHUB_REF_NAME}" \ - --title "${GITHUB_REF_NAME}" \ - --generate-notes \ - --verify-tag + set -euo pipefail + if [[ "${GITHUB_REF}" == refs/tags/* ]]; then + TAG="${GITHUB_REF_NAME}" + else + VER="$(python3 -c "import json; print(json.load(open('custom_components/smart_climate/manifest.json'))['version'])")" + TAG="v${VER}" + fi + echo "Releasing ${TAG}" + + if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then + echo "Tag ${TAG} already exists on origin; skipping tag creation." + else + git tag -a "${TAG}" -m "Smart Climate Controller ${TAG}" + git push origin "${TAG}" + fi + + if gh release view "${TAG}" >/dev/null 2>&1; then + echo "Release ${TAG} already exists; nothing to do." + else + gh release create "${TAG}" \ + --title "${TAG}" \ + --generate-notes \ + --verify-tag + fi From 345e830e9a5b82da4ecc8838bc83118a6e4d3bf3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Jul 2026 12:57:44 +0000 Subject: [PATCH 3/3] Set git identity in release workflow before tagging Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Ro82CB9Y3Sdq8b7Suk9Kys --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b6d6a0..87ffe59 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,8 @@ jobs: if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then echo "Tag ${TAG} already exists on origin; skipping tag creation." else + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git tag -a "${TAG}" -m "Smart Climate Controller ${TAG}" git push origin "${TAG}" fi