From b61f479180f0926951d81efd9e169aa18eb2847d Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Tue, 30 Sep 2025 09:02:50 +0200 Subject: [PATCH] Fix computation of latest version from GH CLI. --- .github/workflows/Parameters.yml | 2 +- .github/workflows/PublishReleaseNotes.yml | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Parameters.yml b/.github/workflows/Parameters.yml index 4489c74..c7eadd6 100644 --- a/.github/workflows/Parameters.yml +++ b/.github/workflows/Parameters.yml @@ -260,7 +260,7 @@ jobs: currentMSYS2Version = "3.12" currentAlphaVersion = "3.14" - currentAlphaRelease = "3.14.0-rc.2" + currentAlphaRelease = "3.14.0-rc.3" if systems == "": print("::error title=Parameter::system_list is empty.") diff --git a/.github/workflows/PublishReleaseNotes.yml b/.github/workflows/PublishReleaseNotes.yml index c65187c..588c29a 100644 --- a/.github/workflows/PublishReleaseNotes.yml +++ b/.github/workflows/PublishReleaseNotes.yml @@ -496,14 +496,14 @@ jobs: # Create JSON inventory if [[ "${{ inputs.inventory-json }}" != "" ]]; then - VERSION="1.0" + STRUCT_VERSION="1.1" # Use GitHub API to ask for latest version printf "Get latest released version via GitHub API ...\n" printf " gh release list --json tagName,isLatest --jq '.[] | select(.isLatest == true) | .tagName' " latestVersion=$(gh release list --json tagName,isLatest --jq '.[] | select(.isLatest == true) | .tagName') if [[ $? -eq 0 ]]; then - if [[ -n "${latestVersion}" ]]; then + if [[ -z "${latestVersion}" ]]; then printf "${ANSI_LIGHT_RED}[UNKNOWN]${ANSI_NOCOLOR}\n" latestVersion="unknown" else @@ -528,7 +528,7 @@ jobs: fi jsonInventory=$(jq -c -n \ - --arg version "${VERSION}" \ + --arg structVersion "${STRUCT_VERSION}" \ --arg date "$(date +"%Y-%m-%dT%H-%M-%S%:z")" \ --argjson jsonMeta "$(jq -c -n \ --arg tag "${{ inputs.tag }}" \ @@ -538,7 +538,8 @@ jobs: --arg release "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.tag }}" \ --argjson jsonLatest "$(jq -c -n \ --arg version "${latestVersion}" \ - '{"version": $version}' \ + --arg release "${{ github.server_url }}/${{ github.repository }}/releases/download/${latestVersion}" \ + '{"version": $version, "release-url": $release}' \ )" \ --argjson categories "$(jq -c -n \ '$ARGS.positional' \ @@ -546,7 +547,7 @@ jobs: )" \ '{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories, "latest": $jsonLatest}' \ )" \ - '{"version": 1.0, "timestamp": $date, "meta": $jsonMeta, "files": {}}' + '{"version": $structVersion, "timestamp": $date, "meta": $jsonMeta, "files": {}}' ) fi