name: 🚀 Release on: push: tags: - 'v*' jobs: release: name: 📦 Create Release runs-on: ubuntu-latest steps: - name: 📥 Checkout Code uses: actions/checkout@v4 - name: 🏷️ Get Version from Tag id: version run: | VERSION=${GITHUB_REF#refs/tags/v} echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT echo "Release version: ${VERSION}" - name: 📦 Create Release Archive run: | cd custom_components zip -r ../adguard-control-hub-${{ steps.version.outputs.VERSION }}.zip adguard_hub/ cd .. ls -la adguard-control-hub-${{ steps.version.outputs.VERSION }}.zip - name: 📋 Generate Release Notes id: release_notes run: | echo "# AdGuard Control Hub v${{ steps.version.outputs.VERSION }}" > release_notes.md echo "" >> release_notes.md echo "## Features" >> release_notes.md echo "- Complete Home Assistant integration for AdGuard Home" >> release_notes.md echo "- Smart client management and discovery" >> release_notes.md echo "- Granular service blocking controls" >> release_notes.md echo "- Emergency unblock capabilities" >> release_notes.md echo "- Real-time statistics and monitoring" >> release_notes.md echo "" >> release_notes.md echo "## Installation" >> release_notes.md echo "1. Download the zip file below" >> release_notes.md echo "2. Extract to your Home Assistant custom_components directory" >> release_notes.md echo "3. Restart Home Assistant" >> release_notes.md echo "4. Add the integration via UI" >> release_notes.md cat release_notes.md - name: 🚀 Create GitHub Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: adguard-control-hub-${{ steps.version.outputs.VERSION }}.zip body_path: release_notes.md draft: false prerelease: false generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: 📤 Upload Release Asset run: | echo "Release created successfully!" echo "Archive: adguard-control-hub-${{ steps.version.outputs.VERSION }}.zip" echo "Tag: ${{ steps.version.outputs.TAG }}"