diff --git a/.github/workflows/NightlyRelease.yml b/.github/workflows/NightlyRelease.yml index 2151cf08..2ff8726f 100644 --- a/.github/workflows/NightlyRelease.yml +++ b/.github/workflows/NightlyRelease.yml @@ -76,6 +76,10 @@ on: type: string required: false default: '' + inventory-categories: + type: string + required: false + default: '' tarball-name: type: string required: false @@ -214,7 +218,16 @@ jobs: # Create JSON inventory if [[ "${{ inputs.inventory-json }}" != "" ]]; then VERSION="1.0" - ORDER=("os-name" "os-version" "os-arch" "runtime" "ghdl-backend") + + # Split categories by ',' into a Bash array. + # See https://stackoverflow.com/a/45201229/3719459 + if [[ "${{ inputs.inventory-categories }}" != "" ]]; then + readarray -td, inventoryCategories <<<"${{ inputs.inventory-categories }}," + unset 'inventoryCategories[-1]' + declare -p inventoryCategories + else + inventoryCategories="" + fi jsonInventory=$(jq -c -n \ --arg version "${VERSION}" \ @@ -224,14 +237,14 @@ jobs: --arg version "${{ inputs.inventory-version }}" \ --arg hash "${{ github.sha }}" \ --arg repo "${{ github.server_url }}/${{ github.repository }}" \ - '{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo}' \ - )" \ - --argjson jsonInfo "$(jq -c -n \ - --arg url "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.nightly_name }}" \ - --argjson order "$(jq -c -n '$ARGS.positional' --args "${ORDER[@]}")" \ - '{"release-url": $url, "categories": $order}' + --arg release "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ inputs.nightly_name }}" \ + --argjson categories "$(jq -c -n \ + '$ARGS.positional' \ + --args "${inventoryCategories[@]}" \ + )" \ + '{"tag": $tag, "version": $version, "git-hash": $hash, "repository-url": $repo, "release-url": $release, "categories": $categories}' \ )" \ - '{"version": 1.0, "timestamp": $date, "meta": $jsonMeta, "info": $jsonInfo, "files": {}}' + '{"version": 1.0, "timestamp": $date, "meta": $jsonMeta, "files": {}}' ) fi diff --git a/.github/workflows/_Checking_Nightly.yml b/.github/workflows/_Checking_Nightly.yml index 6c74d251..88406740 100644 --- a/.github/workflows/_Checking_Nightly.yml +++ b/.github/workflows/_Checking_Nightly.yml @@ -103,12 +103,12 @@ jobs: * iventory.json inventory-json: "inventory.json" inventory-version: 4.2.5 -# inventory-categories: + inventory-categories: "kind1,kind2" assets: | - document: document1.txt: doc;html: Documentation - document: build.log: build;log: Logfile - %tool% - %tool% - other: document1.txt: build;SBOM:SBOM - %version% - other: %prog%.py: app;binary:Application - %tool% - %version% + document: document1.txt: doc,html: Documentation + document: build.log: build,log: Logfile - %tool% - %tool% + other: document1.txt: build,SBOM:SBOM - %version% + other: %prog%.py: app,binary:Application - %tool% - %version% document:!archive1.zip: Archive 1 - zip document:!archive2.tgz: Archive 2 - tgz document:!archive3.tar.gz: Archive 3 - tar.gz