Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
push:
branches:
- "claude/release-latest-commit-**"
tags:
- "v*"
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve tag and publish release
env:
GH_TOKEN: ${{ github.token }}
run: |
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 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

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
2 changes: 1 addition & 1 deletion custom_components/smart_climate/manifest.json
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
Loading