ci: release on every push to master with date-based versioning (vYYYY.MM.DD)
This commit is contained in:
1 parent
37df5732b7
commit
9da7cb8b22
1 file changed
+13
-4
@@ -3,8 +3,6 @@ name: Release
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths:
|
||||
- custom_components/nvidia_shield/manifest.json
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
@@ -24,10 +22,21 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Read version from manifest.json
|
||||
# Date-based versioning: vYYYY.MM.DD.
|
||||
# Priority: an unreleased manifest version wins (bump manifest.json to
|
||||
# force a specific version); otherwise fall back to today's date, so a
|
||||
# plain push to master produces/updates the day's release. The
|
||||
# tag-exists check below dedupes same-day pushes.
|
||||
- name: Determine release version
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(jq -r .version custom_components/nvidia_shield/manifest.json)
|
||||
MANIFEST_VERSION=$(jq -r .version custom_components/nvidia_shield/manifest.json)
|
||||
DATE_VERSION=$(date -u +%Y.%m.%d)
|
||||
if git ls-remote --tags origin "refs/tags/v$MANIFEST_VERSION" | grep -q .; then
|
||||
VERSION="$DATE_VERSION"
|
||||
else
|
||||
VERSION="$MANIFEST_VERSION"
|
||||
fi
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
|
||||
|
||||
|
||||
Reference in new issue
Block a user