Skip to content

ci: add build and release workflow - #2

Closed
eonist wants to merge 1 commit into
mainfrom
feat/add-build-and-release-workflow
Closed

eonist wants to merge 1 commit into
mainfrom
feat/add-build-and-release-workflow

Conversation

@eonist

@eonist eonist commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

Adds build.yml — the cloud-based build and release workflow (mirrors afm-cli pattern).

Builds the local-ai-cli-bin binary on macos-26 (arm64) on every push to main, commits the binary back, advances the v1 floating tag, and uploads the binary as a GitHub release asset.

Context

A previous agent accidentally committed this workflow work directly to main. This PR untangles that: main has been reverted to its clean state (original ci.yml only), and this branch now introduces build.yml cleanly as a proper PR.

Changes

  • + .github/workflows/build.yml — cloud build + release workflow (97 lines)

Merge conflict status

✅ Zero conflicts — git merge --no-ff --no-commit dry run passed cleanly.

@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a GitHub Actions workflow for building and releasing the macOS binary. The main changes are:

  • Build local-ai-cli-bin on pushes to main using macos-26.
  • Commit the generated binary back to main when it changes.
  • Move the floating v1 tag and upload the binary as a GitHub release asset.

Confidence Score: 4/5

This PR has one contained workflow issue to fix before relying on the release artifact.

The workflow is focused and easy to follow, but building before rebasing can attach a stale binary to the latest main commit.

.github/workflows/build.yml

T-Rex T-Rex Logs

What T-Rex did

  • I ran a self-contained git rebase harness to simulate the workflow lines 50-60 by building a text artifact, committing it, and running git pull --rebase origin main; the rebase completed with origin/main content advancing during the build, and HEAD showed source_version=NEW_ON_MAIN_DURING_BUILD while local-ai-cli-bin remained built from OLD_FROM_BASE, demonstrating a stale artifact mismatch.
  • I executed the workflow validation script and reviewed the results, confirming a successful run with EXIT_CODE: 0 and a validated workflow SHA256, while environment notes show Python 3.11.6, PyYAML 6.0.3, and unauthenticated gh with unavailable Swift/actionlint/yamllint/Docker.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
.github/workflows/build.yml Adds the build and release workflow; the post-build rebase can publish a binary built from stale sources if main advances during the run.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Dev as Push to main
participant Build as build job (macos-26)
participant Git as main branch / v1 tag
participant Release as release job
participant GH as GitHub Release

Dev->>Build: Trigger workflow
Build->>Build: swift build -c release
Build->>Build: install local-ai-cli-bin
Build->>Git: Commit and push binary if changed
Build->>Git: Force-update v1 tag
Build->>Release: needs: build
Release->>Git: Checkout main and resolve latest tag
Release->>GH: Upload or create release asset
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Dev as Push to main
participant Build as build job (macos-26)
participant Git as main branch / v1 tag
participant Release as release job
participant GH as GitHub Release

Dev->>Build: Trigger workflow
Build->>Build: swift build -c release
Build->>Build: install local-ai-cli-bin
Build->>Git: Commit and push binary if changed
Build->>Git: Force-update v1 tag
Build->>Release: needs: build
Release->>Git: Checkout main and resolve latest tag
Release->>GH: Upload or create release asset
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
.github/workflows/build.yml:58-60
**Rebuild after rebasing**
`git pull --rebase origin main` runs after the binary is built and committed. When `main` advances while this job is building, the rebase can place an older `local-ai-cli-bin` on top of newer Swift sources, then push that mismatched binary to `main` and release it. Pull/rebase before `swift build`, or rebuild after any successful rebase before committing and pushing the binary.

Reviews (1): Last reviewed commit: "ci: add build and release workflow (mirr..." | Re-trigger Greptile

Comment on lines +58 to +60
git commit -m "chore: rebuild local-ai-cli-bin"
git pull --rebase origin main
git push origin HEAD:main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Rebuild after rebasing
git pull --rebase origin main runs after the binary is built and committed. When main advances while this job is building, the rebase can place an older local-ai-cli-bin on top of newer Swift sources, then push that mismatched binary to main and release it. Pull/rebase before swift build, or rebuild after any successful rebase before committing and pushing the binary.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/build.yml
Line: 58-60

Comment:
**Rebuild after rebasing**
`git pull --rebase origin main` runs after the binary is built and committed. When `main` advances while this job is building, the rebase can place an older `local-ai-cli-bin` on top of newer Swift sources, then push that mismatched binary to `main` and release it. Pull/rebase before `swift build`, or rebuild after any successful rebase before committing and pushing the binary.

How can I resolve this? If you propose a fix, please make it concise.

@eonist eonist closed this Jul 18, 2026
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