Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 55 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ jobs:
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build packages
run: pnpm build

- name: Run linting
run: pnpm lint

Expand All @@ -42,4 +35,58 @@ jobs:
run: pnpm format:check

- name: Run tests
run: pnpm test
run: pnpm test

- name: Install dependencies
run: pnpm install --frozen-lockfile

test-macos:
needs: quality # optional
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with:
version: 10.12.1
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install --frozen-lockfile

- name: Build mac DMG
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
NODE_ENV: production
GH_TOKEN: ${{ secrets.RELEASE_PAT || secrets.GITHUB_TOKEN }}
PUBLISH_RELEASE: false
run: pnpm --filter vibe build:mac

- name: Mount DMG
run: hdiutil attach apps/electron-app/dist/vibe-*.dmg
- name: Install App
run: |
sudo cp -R "/Volumes/COBROWSER/vibe.app" /Applications/
- name: Run App and Check for Errors
Comment on lines +70 to +75
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Hard-coded DMG path is brittle & mount is never detached

  1. hdiutil attach apps/electron-app/dist/vibe-*.dmg assumes a fixed output path. A version bump or directory change will break the workflow.
    Recommend locating the DMG dynamically:
-run: hdiutil attach apps/electron-app/dist/vibe-*.dmg
+run: |
+  DMG_PATH=$(fd --full-path -e dmg '^vibe-.*\.dmg$' apps | head -n1)
+  hdiutil attach "$DMG_PATH"
  1. The DMG volume remains mounted; subsequent jobs on the same runner can collide. Detach after copying:
-      - name: Install App
-        run: |
-          sudo cp -R "/Volumes/COBROWSER/vibe.app" /Applications/
+      - name: Install App
+        run: |
+          VOLUME="/Volumes/COBROWSER"
+          sudo cp -R "$VOLUME/vibe.app" /Applications/
+          hdiutil detach "$VOLUME"

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .github/workflows/ci.yml around lines 70 to 75, the DMG path is hard-coded
which can break the workflow if the version or directory changes, and the
mounted DMG is never detached causing potential conflicts. Fix this by
dynamically locating the DMG file using a pattern or variable to find the latest
or correct DMG path, then after copying the app, run a command to detach the
mounted volume to clean up before the next steps or jobs.

run: |
set +e
/Applications/vibe.app/Contents/MacOS/vibe &> app_output.log &
APP_PID=$!
sleep 10
kill $APP_PID
if grep -i "error" app_output.log; then
echo "Error found in application output."
exit 1
fi
set -e
- name: Upload App Logs
if: always()
uses: actions/upload-artifact@v3
with:
name: app-logs
path: app_output.log
Loading