Skip to content

Build frontend in release workflow so binaries actually get produced#1159

Merged
elemdos merged 2 commits into
mainfrom
fix/release-workflow-frontend-build
Jun 3, 2026
Merged

Build frontend in release workflow so binaries actually get produced#1159
elemdos merged 2 commits into
mainfrom
fix/release-workflow-frontend-build

Conversation

@elemdos
Copy link
Copy Markdown
Collaborator

@elemdos elemdos commented Jun 3, 2026

Summary

  • Add Node 22 + npm ci + the two vite build steps to the matrix job so internal/admin.go's //go:embed build/* has the SvelteKit output to embed.
  • Bump Go from 1.21 → 1.25 to match the Dockerfile and devenv.
  • Inject buildVersion / buildTime ldflags so released binaries report their version (mirrors Dockerfile and tag.yml).
  • Switch the release step to draft: true and drop generate_release_notes so an existing draft (e.g. the current v3.2.0 with hand-written notes) gets assets uploaded in place rather than published or having auto-generated notes appended.

The existing workflow has never produced working binaries — every v* tag push must have failed at go build because there's no internal/build/ directory until the frontend has been built. This is why the v3.1.0 release has empty assets and primo dev (in primo-cli) currently 404s.

Test plan

  • Merge this, then push the v3.2.0 tag.
  • Workflow runs all 5 matrix jobs to completion.
  • All 5 binaries appear as assets on the existing v3.2.0 draft.
  • Draft remains a draft (manual publish step).

Summary by CodeRabbit

  • Chores
    • Build pipeline now runs frontend setup and bundle steps before compiling backend binaries.
    • Toolchain updated to a newer Go version.
    • Produced binaries include embedded version and build timestamp metadata.
    • Release publishing now uploads assets to a draft release instead of auto-creating release notes.

release.yml runs `go build` directly with no node steps, so
internal/admin.go's `//go:embed build/*` fails — the Dockerfile builds
the SvelteKit app first, but the workflow doesn't, so tag pushes never
actually produce binaries.

Add Node 22 + npm ci + the two vite builds (matching the Dockerfile),
align Go to 1.25 (matched in Dockerfile, devenv), and inject the same
buildVersion/buildTime ldflags the Dockerfile sets so the resulting
binaries report their version. Use github.ref_name as PRIMO_VERSION,
mirroring tag.yml's Docker build-args.

The release upload step now sets draft: true and drops
generate_release_notes so an existing draft (e.g. v3.2.0 with
hand-written notes) is updated in place rather than published or having
notes mangled.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8e45a2a5-bb99-458a-a1a6-900faf3f0489

📥 Commits

Reviewing files that changed from the base of the PR and between efd62d6 and b49dc3f.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The release workflow now builds frontend assets (Node.js v22, npm ci, SvelteKit, Vite) before compiling Go binaries. Go toolchain upgrades from v1.21 to v1.25, and the Go build injects build timestamp and version via ldflags. The release step now uploads binaries/* to a draft release (draft: true).

Changes

Release Workflow Enhancement

Layer / File(s) Summary
Build pipeline with frontend and Go toolchain
.github/workflows/release.yml
Node.js (v22) setup and frontend build steps (npm ci, SvelteKit sync, SvelteKit and Vite builds) are inserted before Go compilation. Go toolchain upgraded from 1.21 to 1.25. go build invocation extended with -ldflags to inject internal.buildTime and internal.buildVersion from the tag name.
Release publishing to draft with binaries
.github/workflows/release.yml
Release step changed from creating a release with auto-generated release notes to uploading binaries/* artifacts to a draft release by setting draft: true.

Sequence Diagram(s)

sequenceDiagram
  participant Actions as GitHub Actions
  participant Node as Node.js (v22)
  participant Frontend as SvelteKit/Vite build
  participant Go as Go toolchain (1.25)
  participant Release as GitHub Release

  Actions->>Node: setup-node (v22)
  Actions->>Node: run `npm ci`
  Actions->>Frontend: sveltekit sync & build, vite build
  Frontend->>Actions: frontend artifacts
  Actions->>Go: go build with -ldflags (internal.buildTime, internal.buildVersion)
  Go->>Actions: binaries/*
  Actions->>Release: upload binaries to draft release (draft: true)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A workflow hops along with Node in tow,
Frontend bundles hum while the Go binaries grow,
Timestamps tucked into ldflags' seam,
Drafted releases gather the build-time dream,
A rabbit cheers the CI stream 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding frontend build steps to the release workflow to ensure binaries are properly produced with embedded assets.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-workflow-frontend-build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

42-47: 🏗️ Heavy lift

Build frontend once and fan out as an artifact to matrix jobs.

The frontend build runs in every OS/arch leg, but embedded assets are platform-independent. Splitting this into a single frontend job (upload build/) plus per-target Go build jobs will reduce release time/cost and lower flake surface.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 42 - 47, The workflow currently
runs the "Build frontend" steps (npm ci; npx svelte-kit sync; npx vite ...
build) in every matrix job; instead create a single dedicated CI job named e.g.
"build-frontend" that runs those steps once, uploads the produced frontend
artifact (upload the build/ directory) using actions/upload-artifact, and remove
the frontend build steps from the per-target Go matrix jobs; then in each Go
build job add a step to download the artifact (actions/download-artifact) and
place the frontend assets where the Go build expects them before building. Use
the existing "Build frontend" run steps as the body of the single job and
reference the artifact name "build" when uploading/downloading so matrix jobs
can consume it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 89-90: Update the GitHub Actions step named "Upload assets to
release" to use the newer action version by changing the uses value from
softprops/action-gh-release@v1 to softprops/action-gh-release@v3 (or
softprops/action-gh-release@v2.6.2 if you must stay on Node 20); locate the step
by the step name "Upload assets to release" and the uses field and replace the
version tag accordingly, then run the workflow to verify compatibility on
GitHub-hosted runners.
- Line 38: Replace floating action tags with immutable commit SHAs for all
referenced actions: locate uses: entries for actions/checkout@v4,
actions/setup-node@v4, actions/setup-go@v5, actions/upload-artifact@v4,
actions/download-artifact@v4, and softprops/action-gh-release@v1 and swap the
tag (e.g., `@v4` or `@v1`) for the corresponding full commit SHA from each action's
GitHub repo (use the commit that matches the intended tag/release), updating the
uses: lines accordingly; ensure you pin each occurrence to a full 40-character
SHA and verify the workflow still runs by testing the workflow or running a
local lint.

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 42-47: The workflow currently runs the "Build frontend" steps (npm
ci; npx svelte-kit sync; npx vite ... build) in every matrix job; instead create
a single dedicated CI job named e.g. "build-frontend" that runs those steps
once, uploads the produced frontend artifact (upload the build/ directory) using
actions/upload-artifact, and remove the frontend build steps from the per-target
Go matrix jobs; then in each Go build job add a step to download the artifact
(actions/download-artifact) and place the frontend assets where the Go build
expects them before building. Use the existing "Build frontend" run steps as the
body of the single job and reference the artifact name "build" when
uploading/downloading so matrix jobs can consume it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 08f68e94-62b7-4aa8-ab0b-6d5e9bfe20cf

📥 Commits

Reviewing files that changed from the base of the PR and between 27cfbbf and efd62d6.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
v1 predates the current GitHub Actions runtime updates and actionlint
flags it as too old to run on hosted runners. v3 (April 2026) moved the
action to Node 24; same inputs, same draft+existing-release behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@elemdos elemdos enabled auto-merge (squash) June 3, 2026 03:21
@elemdos elemdos merged commit d4b99cf into main Jun 3, 2026
6 checks passed
@elemdos elemdos deleted the fix/release-workflow-frontend-build branch June 3, 2026 03:21
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.

1 participant