Skip to content

Handle flattened artifact extraction in release asset publishing workflow - #16

Merged
bubio merged 2 commits into
mainfrom
copilot/fix-publish-release-job
Jul 13, 2026
Merged

Handle flattened artifact extraction in release asset publishing workflow#16
bubio merged 2 commits into
mainfrom
copilot/fix-publish-release-job

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The publish-release / publish job failed because the reusable release workflow assumed downloaded artifacts always extract to release-assets/<artifact-name>/. In the failing run, the artifact was extracted directly into release-assets/, so ZIP packaging aborted before upload.

  • Root cause

    • publish-release-assets.yml only supported one extraction layout (release-assets/<artifact-name>), but actions/download-artifact@v8 can produce a flattened layout for single-artifact downloads.
  • Workflow logic update

    • Added a guarded fallback for ZIP mappings:
      • keep using release-assets/<artifact-name> when present.
      • if missing, allow fallback to release-assets/ only when there is exactly one ZIP mapping and release-assets/ is non-empty.
    • This preserves strict behavior for multi-mapping cases and still fails fast on unexpected layouts.
  • ZIP output path hardening

    • Switched ZIP destination to an absolute path ($(pwd)/release-upload/...) to avoid relative-path breakage across different working directories/layouts.
artifact_dir="release-assets/$artifact_name"
if [ ! -d "$artifact_dir" ]; then
  if [ "$zip_mapping_count" -eq 1 ] && [ -d release-assets ] && find release-assets -mindepth 1 -print -quit | grep -q .; then
    artifact_dir="release-assets"
  else
    echo "Artifact directory not found: $artifact_dir"
    exit 1
  fi
fi

output_zip="$(pwd)/release-upload/$zip_name"
(cd "$artifact_dir" && zip -r "$output_zip" .)

Copilot AI changed the title [WIP] Fix failing GitHub Actions job publish-release Handle flattened artifact extraction in release asset publishing workflow Jul 13, 2026
Copilot finished work on behalf of bubio July 13, 2026 15:06
Copilot AI requested a review from bubio July 13, 2026 15:06
@bubio
bubio marked this pull request as ready for review July 13, 2026 22:10
@bubio
bubio merged commit 6fc74b5 into main Jul 13, 2026
16 checks passed
@bubio
bubio deleted the copilot/fix-publish-release-job branch July 13, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants