From 1778a89307b696f38ed532dde2470db3d31fced8 Mon Sep 17 00:00:00 2001 From: Jonathan Turnock <16135506+JonathanTurnock@users.noreply.github.com> Date: Wed, 3 Jun 2026 03:19:14 +0100 Subject: [PATCH] ci(release): attach assets to the CLI's v tag, not releases[0] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The release-assets matrix builds all failed at `actions/checkout`: it was handed `ref: pseudoscript-layout-v0.1.0` (a library entry), which is not a git tag — the only tag is the CLI's `v0.1.0`. `release.yml` passed `releases[0].tag`, but the version-bump PR touches the library crates too, so release-plz's `releases` array is order-dependent and [0] landed on a library. Resolve the CLI tag explicitly by its `v` prefix (libraries carry a `-v…` name) and gate `assets` on it being non-empty. Now every target checks out the real tag and builds. The macOS-Intel (`macos-13`) target is unaffected — it just waits longer in the scarcer macOS queue. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/release.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f9941dc..5d181ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,8 +35,7 @@ jobs: name: Release runs-on: ubuntu-latest outputs: - releases_created: ${{ steps.release-plz.outputs.releases_created }} - releases: ${{ steps.release-plz.outputs.releases }} + cli_tag: ${{ steps.cli.outputs.tag }} steps: - uses: actions/checkout@v4 with: @@ -48,18 +47,32 @@ jobs: command: release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # The version-bump PR touches the library crates too, so release-plz can + # report several entries; only the `pseudoscript` CLI is tagged, with the + # canonical `v` tag (libraries would carry a `-v…` name). + # Pick that tag by its `v` prefix — `releases[0]` is order-dependent and + # was landing on a library entry, so `assets` checked out a tag that does + # not exist and every build failed at checkout. Empty when nothing was + # released, which skips `assets`. + - id: cli + name: Resolve the pseudoscript CLI release tag + env: + RELEASES: ${{ steps.release-plz.outputs.releases }} + run: | + tag=$(jq -r 'map(select(.tag | startswith("v"))) | .[0].tag // empty' <<<"${RELEASES:-[]}") + echo "tag=$tag" >> "$GITHUB_OUTPUT" + echo "Resolved CLI tag: ${tag:-}" # Build the cross-platform binaries + checksums and attach them, with the # install scripts, to the freshly published release — in this same run, so it # does not depend on a release-event trigger (which GITHUB_TOKEN suppresses). - # The single-crate release config means releases[0] is the `v` tag. assets: name: Release assets needs: release - if: needs.release.outputs.releases_created == 'true' + if: needs.release.outputs.cli_tag != '' permissions: contents: write uses: ./.github/workflows/release-assets.yml with: - tag: ${{ fromJSON(needs.release.outputs.releases)[0].tag }} + tag: ${{ needs.release.outputs.cli_tag }} secrets: inherit