From 164f7cf76afee55ffc048ed14a09caef97811991 Mon Sep 17 00:00:00 2001 From: Matysh Date: Sat, 8 Aug 2026 19:43:24 +0300 Subject: [PATCH] chore(hacs): zip_release + workflow attaching houseplan.zip to every release HACS will install from the named asset instead of the auto zipball, so GitHub's public download counter becomes a per-version install metric. The workflow also has a manual dispatch to backfill an existing release. --- .github/workflows/release-zip.yml | 40 +++++++++++++++++++++++++++++++ hacs.json | 4 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-zip.yml diff --git a/.github/workflows/release-zip.yml b/.github/workflows/release-zip.yml new file mode 100644 index 00000000..6669fcad --- /dev/null +++ b/.github/workflows/release-zip.yml @@ -0,0 +1,40 @@ +name: Attach HACS zip to release +# hacs.json declares zip_release + filename=houseplan.zip, so every release +# (prereleases included) must carry the asset — HACS installs from it and +# GitHub's public download counter becomes a free per-version install metric +# (owner request, 2026-08-08). Like announce.yml, the workflow file lives at +# the TAGGED commit: betas cut from dev pick it up as soon as this file is on +# dev, stable tags once it reaches main. +# workflow_dispatch lets us attach the zip to an EXISTING release (needed +# once for the latest stable after the hacs.json change reaches main). +on: + release: + types: [published] + workflow_dispatch: + inputs: + tag: + description: "Existing release tag to attach the zip to" + required: true +permissions: + contents: write +jobs: + zip: + runs-on: ubuntu-latest + steps: + - name: Resolve tag + id: tag + env: + EVENT_TAG: ${{ github.event.release.tag_name }} + INPUT_TAG: ${{ github.event.inputs.tag }} + run: echo "tag=${EVENT_TAG:-$INPUT_TAG}" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@v4 + with: + ref: ${{ steps.tag.outputs.tag }} + - name: Build houseplan.zip (contents of custom_components/houseplan at zip root) + run: cd custom_components/houseplan && zip -qr ../../houseplan.zip . + - name: Sanity check + run: unzip -l houseplan.zip | grep -q "manifest.json" + - name: Upload asset + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload "${{ steps.tag.outputs.tag }}" houseplan.zip --clobber --repo "$GITHUB_REPOSITORY" diff --git a/hacs.json b/hacs.json index e6261fec..b654f82c 100755 --- a/hacs.json +++ b/hacs.json @@ -1,5 +1,7 @@ { "name": "House Plan (card + storage)", "render_readme": true, - "homeassistant": "2024.6.0" + "homeassistant": "2024.6.0", + "zip_release": true, + "filename": "houseplan.zip" }