Skip to content

fix: switch to htd-client-ha PyPI package; drop git dependency #4

fix: switch to htd-client-ha PyPI package; drop git dependency

fix: switch to htd-client-ha PyPI package; drop git dependency #4

name: Create Release
on:
push:
branches:
- main
jobs:
create_release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get manifest.json info
id: manifest-info
run: echo "version=$(jq -r '.version' custom_components/htd/manifest.json)" >> $GITHUB_OUTPUT
- name: Check if version is already published
run: |
VERSION="${{ steps.manifest-info.outputs.version }}"
echo "Version to check: $VERSION"
RESPONSE=$(curl -s https://api.github.com/repos/theharshl/htd-home-assistant/releases)
if echo "$RESPONSE" | grep -q "\"tag_name\": \"v$VERSION\""; then
echo "Version $VERSION has already been published. Failing the build."
exit 1
else
echo "Version $VERSION is not published. Proceeding."
fi
- name: Package
run: cd custom_components/htd && zip -r ../../htd.zip * && cd ../..
- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: v${{ steps.manifest-info.outputs.version }}
tag_name: v${{ steps.manifest-info.outputs.version }}
files: htd.zip