Skip to content

Commit c82e805

Browse files
committed
fix(release): stamp manifest.json version so HA shows the real version
Home Assistant displays the integration version from custom_components/spoolman/manifest.json, which was a hardcoded '0.0.0' placeholder that nothing in the release flow updated — so every release (including the location fix shipped in v1.4.0-dev.3) showed 'Version 0.0.0' in HA. - publish.sh: jq-set manifest.json 'version' to ${nextRelease.version} before building the zip, so the shipped artifact carries the real version. - .releaserc.js: add manifest.json to @semantic-release/git assets so the bumped version is committed back to the branch. Re-releases the empty-Locations fix under a correctly-stamped version. Closes #854
1 parent a3d2233 commit c82e805

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

.releaserc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ module.exports = {
5959
assets: [
6060
"hacs.json",
6161
"CHANGELOG.md",
62-
"README.md"
62+
"README.md",
63+
"custom_components/spoolman/manifest.json"
6364
]
6465
}
6566
],

scripts/publish.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ branchName="$2"
1212
commitsLength="$3"
1313
timestamp="$4"
1414

15+
# manifest.json mit der Release-Version stempeln. Muss VOR dem Zippen
16+
# passieren, damit das ausgelieferte Zip die korrekte Version enthält
17+
# (Home Assistant zeigt die 'version' aus der manifest.json an).
18+
manifestFile="custom_components/spoolman/manifest.json"
19+
if [ -f "$manifestFile" ]; then
20+
jq ".version = \"${nextReleaseVersion}\"" "$manifestFile" > manifest.tmp.json
21+
mv manifest.tmp.json "$manifestFile"
22+
echo "Die Eigenschaft 'version' in '$manifestFile' wurde auf '${nextReleaseVersion}' gesetzt."
23+
else
24+
echo "Die Datei '$manifestFile' wurde nicht gefunden."
25+
fi
26+
1527
# Befehl ausführen, um das ZIP-Archiv zu erstellen
1628
zipCommand="zip ../../dist/spoolman-homeassistant_${nextReleaseVersion}.zip . -r"
1729
echo "Führe folgenden Befehl aus: $zipCommand"

0 commit comments

Comments
 (0)