Skip to content

Commit c724385

Browse files
committed
Fix missing version
1 parent 5291bd5 commit c724385

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/update-version.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,24 @@ jobs:
1818

1919
- name: Update manifest version
2020
run: |
21-
VERSION=${GITHUB_REF_NAME#v}
22-
echo "Updating version to $VERSION"
21+
TAG_NAME="${{ github.event.release.tag_name }}"
22+
VERSION="${TAG_NAME#v}"
23+
if [ -z "$VERSION" ] || [ "$VERSION" = "$TAG_NAME" ] && [[ "$TAG_NAME" == "v" ]]; then
24+
echo "::error::Release tag '$TAG_NAME' does not contain a version (expected format: v<version>)"
25+
exit 1
26+
fi
27+
echo "Updating version to $VERSION from tag $TAG_NAME"
2328
jq --arg v "$VERSION" '.version = $v' custom_components/victron_mqtt/manifest.json > tmp.json
2429
mv tmp.json custom_components/victron_mqtt/manifest.json
2530
2631
- name: Commit and push
2732
run: |
33+
VERSION="${{ github.event.release.tag_name }}"
34+
VERSION="${VERSION#v}"
2835
git config user.name "github-actions[bot]"
2936
git config user.email "github-actions[bot]@users.noreply.github.com"
3037
git add custom_components/victron_mqtt/manifest.json
31-
git commit -m "Bump version to ${GITHUB_REF_NAME#v}" || exit 0
38+
git commit -m "Bump version to ${VERSION}" || exit 0
3239
git push
3340
3441
- name: Update release tag to include version bump

custom_components/victron_mqtt/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"X_MqttOnLan": "1"
1919
}
2020
],
21-
"version": ""
21+
"version": "2026.6.5"
2222
}

0 commit comments

Comments
 (0)