diff --git a/.github/workflows/catalog.yml b/.github/workflows/catalog.yml index 2dd7a62..300781b 100644 --- a/.github/workflows/catalog.yml +++ b/.github/workflows/catalog.yml @@ -108,7 +108,13 @@ jobs: # bundle; see the header of this script for what happens while core has # not published it yet. - name: Fetch package-ci harness - run: tools/fetch-package-ci.sh --out=package-ci --core-repo="${CORE_REPO}" + # The core version found above, not the release published last: a 7.0.x patch + # published after a 7.1 beta would otherwise bring the older builder. + # 0.0.0 means no core release was found; the newest bundle is then the best guess. + run: | + REF="${{ steps.core-version.outputs.version }}" + [ "$REF" = "0.0.0" ] && REF="" + tools/fetch-package-ci.sh --out=package-ci --core-repo="${CORE_REPO}" ${REF:+--ref="$REF"} - name: Check whether build-catalog.php has shipped yet id: builder diff --git a/tools/fetch-package-ci.sh b/tools/fetch-package-ci.sh index a4913e2..97f06d7 100755 --- a/tools/fetch-package-ci.sh +++ b/tools/fetch-package-ci.sh @@ -39,8 +39,8 @@ # # --out=DIR where to assemble package-ci/ [default: package-ci] # --core-repo=R the core repository [default: mindstellar/shopclass] -# --ref=REF pin the fallback clone to this tag/branch instead of -# auto-detecting the newest release tag +# --ref=REF take the bundle from this release, and pin the fallback +# clone to this tag/branch, instead of the newest release # # Exit codes: 0 = at least the required components (package-lint.php, # Compatibility.php, deprecated-api.json) are present in package-ci/; @@ -140,8 +140,10 @@ try_release_tarball() { fi local asset_url - asset_url="$(printf '%s' "$releases" | jq -r ' + # With --ref the bundle comes from that release; without it, from the newest one. + asset_url="$(printf '%s' "$releases" | jq -r --arg ref "$REF" ' map(select(.draft == false)) + | if $ref != "" then map(select(.tag_name == $ref)) else . end | sort_by(.published_at) | reverse | map(.assets[]? | select(.name == "shopclass-package-ci.tar.gz") | {url: .browser_download_url, tag: .tag_name})