From 9da7cb8b228d5da922235ae1589c0c82570cdaad Mon Sep 17 00:00:00 2001 From: Levi Date: Thu, 8 Oct 2026 07:26:13 +0100 Subject: [PATCH] ci: release on every push to master with date-based versioning (vYYYY.MM.DD) --- .github/workflows/release.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9606a2..5c4459c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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"