Skip to content

fix: create release before uploading artifacts#112

Merged
jcanizalez merged 2 commits intomainfrom
fix/release-create-before-upload
Mar 26, 2026
Merged

fix: create release before uploading artifacts#112
jcanizalez merged 2 commits intomainfrom
fix/release-create-before-upload

Conversation

@jcanizalez
Copy link
Copy Markdown
Owner

Summary

  • Add create-release job that runs before all platform builds
  • Creates a draft GitHub release (with --prerelease for beta/alpha/rc tags) if one doesn't already exist
  • All build jobs (build-macos, build-windows, build-linux) now needs: create-release
  • Fixes beta releases failing with release not found when no release exists for the tag

Root cause

The v0.4.0-beta.0 release failed because all 3 build jobs tried to gh release upload to a release that didn't exist. Stable releases worked by coincidence (draft releases were accumulating assets from previous runs), but betas had no pre-existing release to upload to.

Test plan

  • Re-run v0.4.0-beta.0 tag after merge to verify the fix
  • Verify stable releases still work (create-release skips if release already exists)

The release workflow assumed the release already existed when build jobs
tried to upload artifacts. For beta/prerelease tags, no release was
created beforehand, causing all three platform builds to fail with
"release not found".

Add a create-release job that runs first and creates the release (as
draft) if it doesn't already exist. All build jobs now depend on it.
Copilot AI review requested due to automatic review settings March 26, 2026 04:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a preparatory GitHub Actions job to ensure a GitHub Release exists (draft + prerelease for beta/alpha/rc tags) before platform build jobs attempt to upload artifacts, preventing “release not found” failures on fresh prerelease tags.

Changes:

  • Introduces a create-release job that creates a draft release (and marks it prerelease for beta/alpha/rc tags) when missing.
  • Makes build-macos, build-windows, and build-linux depend on create-release via needs.
  • Keeps behavior of skipping creation when a release for the tag already exists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +18 to +26
- name: Determine tag
id: tag
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
tag="${GITHUB_REF_NAME}"
else
tag="v$(node -p 'require("./package.json").version')"
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Determine tag uses node -p ... but this job never installs/pins Node.js (unlike the build jobs which run actions/setup-node). This makes the job depend on whatever Node version happens to be preinstalled on ubuntu-latest, and can fail if Node isn’t present or changes. Add an actions/setup-node step (matching the repo’s pinned version) before running Node, or avoid Node entirely by deriving the tag from the event context/inputs.

Copilot uses AI. Check for mistakes.
@jcanizalez jcanizalez merged commit 03b689b into main Mar 26, 2026
1 check passed
@jcanizalez jcanizalez deleted the fix/release-create-before-upload branch March 26, 2026 05:03
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