Enhance build configuration for macOS and update artifact naming #22

Merged
Sudo-Ivan merged 6 commits from universal-mac-build into master 2025-12-06 04:43:57 +00:00
2 changed files with 13 additions and 6 deletions
Showing only changes of commit a74a6869ea - Show all commits

View File

@@ -80,10 +80,10 @@ jobs:
release_artifacts: "dist/*-win-installer.exe,dist/*-win-portable.exe"
build_input: build_windows
- name: mac
os: macos-13
os: macos-14
node: 18
python: "3.11"
release_artifacts: "dist/*-mac.dmg"
release_artifacts: "dist/*-mac-*.dmg"
build_input: build_mac
- name: linux
os: ubuntu-latest
1
@@ -173,7 +173,7 @@ jobs:
mv dist/*.whl python-dist/
rm -rf dist
- name: Build Electron App
- name: Build Electron App (Universal)
if: |
github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true)

View File

@@ -12,7 +12,9 @@
"electron-postinstall": "electron-builder install-app-deps",
"electron": "npm run electron-postinstall && npm run build && electron .",
"dist": "npm run electron-postinstall && npm run build && electron-builder --publish=never",
"dist-prebuilt": "npm run electron-postinstall && npm run build-backend && electron-builder --publish=never"
"dist-prebuilt": "npm run electron-postinstall && npm run build-backend && electron-builder --publish=never",
"dist:mac-arm64": "npm run electron-postinstall && npm run build && electron-builder --mac --arm64 --publish=never",
"dist:mac-universal": "npm run electron-postinstall && npm run build && electron-builder --mac --universal --publish=never"
},
coderabbitai[bot] commented 2025-12-01 18:43:12 +00:00 (Migrated from github.com)
Review

⚠️ Potential issue | 🟠 Major

New dist:mac-arm64 and dist:mac-universal scripts are unused by the workflow.

Three distribution scripts now exist:

  • dist: full build for current platform (used by legacy code)
  • dist-prebuilt: skips frontend, used by workflow for ALL platforms
  • dist:mac-arm64 & dist:mac-universal: architecture-specific, but never invoked

The workflow always calls npm run dist-prebuilt regardless of platform, so the new macOS-specific scripts with explicit architecture targets are dead code. This defeats the purpose of offering architecture-specific builds.

Either:

  1. Update the workflow to invoke the appropriate script based on matrix platform, or
  2. Remove the unused scripts if they're not needed.

If option 1, update .github/workflows/build.yml line 180 to:

-        run: npm run dist-prebuilt
+        run: |
+          case "${{ matrix.name }}" in
+            mac) npm run dist:mac-universal ;;
+            *) npm run dist ;;
+          esac

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

πŸ€– Prompt for AI Agents
In package.json around lines 15 to 17 the new scripts "dist:mac-arm64" and
"dist:mac-universal" are never used by CI because the workflow always runs "npm
run dist-prebuilt"; either remove those two architecture-specific scripts if you
don't plan to use them, or update the GitHub Actions workflow to invoke the
correct script per platformβ€”specifically modify .github/workflows/build.yml at
line 180 to run the appropriate dist script based on the job matrix (e.g., use a
conditional or matrix variable to call npm run dist:mac-arm64 for macOS/arm64
and npm run dist:mac-universal for macOS/universal) so the architecture-specific
builds are actually executed.

βœ… Addressed in commits c95d2fd to d69a3e8

_⚠️ Potential issue_ | _🟠 Major_ **New `dist:mac-arm64` and `dist:mac-universal` scripts are unused by the workflow.** Three distribution scripts now exist: - `dist`: full build for current platform (used by legacy code) - `dist-prebuilt`: skips frontend, used by workflow for ALL platforms - `dist:mac-arm64` & `dist:mac-universal`: architecture-specific, but never invoked The workflow always calls `npm run dist-prebuilt` regardless of platform, so the new macOS-specific scripts with explicit architecture targets are dead code. This defeats the purpose of offering architecture-specific builds. Either: 1. **Update the workflow** to invoke the appropriate script based on matrix platform, or 2. **Remove the unused scripts** if they're not needed. If option 1, update `.github/workflows/build.yml` line 180 to: ```diff - run: npm run dist-prebuilt + run: | + case "${{ matrix.name }}" in + mac) npm run dist:mac-universal ;; + *) npm run dist ;; + esac ``` > Committable suggestion skipped: line range outside the PR's diff. <details> <summary>πŸ€– Prompt for AI Agents</summary> ``` In package.json around lines 15 to 17 the new scripts "dist:mac-arm64" and "dist:mac-universal" are never used by CI because the workflow always runs "npm run dist-prebuilt"; either remove those two architecture-specific scripts if you don't plan to use them, or update the GitHub Actions workflow to invoke the correct script per platformβ€”specifically modify .github/workflows/build.yml at line 180 to run the appropriate dist script based on the job matrix (e.g., use a conditional or matrix variable to call npm run dist:mac-arm64 for macOS/arm64 and npm run dist:mac-universal for macOS/universal) so the architecture-specific builds are actually executed. ``` </details> <!-- This is an auto-generated comment by CodeRabbit --> βœ… Addressed in commits c95d2fd to d69a3e8
"license": "MIT",
"engines": {
@@ -36,9 +38,14 @@
"buildResources": "electron/build"
coderabbitai[bot] commented 2025-12-01 18:43:12 +00:00 (Migrated from github.com)
Review

⚠️ Potential issue | πŸ”΄ Critical

🧩 Analysis chain

🏁 Script executed:

# Search for hardcoded assumptions about artifact names in scripts
rg -nP 'ReticulumMeshChat.*\-mac' --type sh --type js --type json

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 55


🏁 Script executed:

# Also search for workflow files and patterns
fd -e yml -e yaml | head -20

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 91


🏁 Script executed:

# Check if there are references to the workflow pattern mentioned (line 86)
rg -nP 'dist/\*-mac-\*\.dmg' --type yml --type yaml

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 100


🏁 Script executed:

# Search for electron-builder configuration files
fd -e js -e json -e yml -e yaml | xargs rg -l 'electron-builder\|artifactName' | head -20

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 55


🏁 Script executed:

# Check repository structure
git ls-files | grep -E "(package\.json|workflow|\.github)" | head -20

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 145


🏁 Script executed:

# Read package.json to verify line 48
cat -n package.json | sed -n '40,60p'

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 789


🏁 Script executed:

# Find all workflow files
fd -e yaml -e yml 2>/dev/null | head -20

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 91


🏁 Script executed:

# Read the build.yml workflow file, focusing around line 86
cat -n .github/workflows/build.yml | sed -n '75,100p'

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 1127


🏁 Script executed:

# Also check for any dist pattern references in workflow
rg -n 'dist/.*\*' .github/workflows/build.yml

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 561


🏁 Script executed:

# Search for any artifact upload or download steps
rg -n -A 2 -B 2 'artifacts\|dist' .github/workflows/build.yml | head -40

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 55


🏁 Script executed:

# Check if there are any build artifacts or examples showing actual filenames
find . -name "*.dmg" -o -name "*darwin*" -o -name "*mac*" 2>/dev/null | grep -i artifact | head -20

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 55


🏁 Script executed:

# Search for electron-builder configuration and ${os} variable usage
rg -n '\$\{os\}' --type json --type js

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 520


🏁 Script executed:

# Check the entire mac configuration in package.json
cat -n package.json | sed -n '35,75p'

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 1312


🏁 Script executed:

# Look for any build scripts or documentation about artifact naming
rg -n 'artifact' package.json

Repository: Sudo-Ivan/reticulum-meshchatX

Length of output: 455


🌐 Web query:

electron-builder ${os} variable macOS darwin value

πŸ’‘ Result:

In electron-builder the ${os} placeholder for macOS equals "darwin". [1][2]

Sources:
[1] electron-builder docs β€” Configuration / Common Configuration.
[2] electron-builder docs (variable substitution summary).


Critical artifact naming mismatch: ${os} resolves to "darwin" but workflow patterns expect "mac".

The artifactName change in package.json (line 48) uses ${os} which electron-builder resolves to "darwin" for macOS, producing filenames like ReticulumMeshChat-v{version}-darwin-universal.dmg. However, the workflow patterns at lines 86 and 192 expect dist/*-mac-*.dmg and dist/*-mac.dmg respectively, which will not match the generated artifacts. Either update the artifactName to use a hardcoded "mac" string instead of ${os}, or update the workflow patterns to expect "darwin-*" for the macOS artifacts.

πŸ€– Prompt for AI Agents
In package.json around line 48, the artifactName uses ${os} which resolves to
"darwin" for macOS, but CI workflow patterns expect "mac", causing mismatched
artifact names; fix by replacing ${os} with a hardcoded "mac" in artifactName
(e.g., ReticulumMeshChat-v${version}-mac-${arch}.${ext}) or alternatively update
the workflow glob patterns at the referenced workflow lines to match "darwin"
(e.g., change dist/*-mac-*.dmg to dist/*-darwin-*.dmg and dist/*-mac.dmg to
dist/*-darwin.dmg) so artifact names and workflow expectations align.

βœ… Addressed in commits c95d2fd to d69a3e8

_⚠️ Potential issue_ | _πŸ”΄ Critical_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell # Search for hardcoded assumptions about artifact names in scripts rg -nP 'ReticulumMeshChat.*\-mac' --type sh --type js --type json ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 55 --- 🏁 Script executed: ```shell # Also search for workflow files and patterns fd -e yml -e yaml | head -20 ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 91 --- 🏁 Script executed: ```shell # Check if there are references to the workflow pattern mentioned (line 86) rg -nP 'dist/\*-mac-\*\.dmg' --type yml --type yaml ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 100 --- 🏁 Script executed: ```shell # Search for electron-builder configuration files fd -e js -e json -e yml -e yaml | xargs rg -l 'electron-builder\|artifactName' | head -20 ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 55 --- 🏁 Script executed: ```shell # Check repository structure git ls-files | grep -E "(package\.json|workflow|\.github)" | head -20 ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 145 --- 🏁 Script executed: ```shell # Read package.json to verify line 48 cat -n package.json | sed -n '40,60p' ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 789 --- 🏁 Script executed: ```shell # Find all workflow files fd -e yaml -e yml 2>/dev/null | head -20 ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 91 --- 🏁 Script executed: ```shell # Read the build.yml workflow file, focusing around line 86 cat -n .github/workflows/build.yml | sed -n '75,100p' ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 1127 --- 🏁 Script executed: ```shell # Also check for any dist pattern references in workflow rg -n 'dist/.*\*' .github/workflows/build.yml ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 561 --- 🏁 Script executed: ```shell # Search for any artifact upload or download steps rg -n -A 2 -B 2 'artifacts\|dist' .github/workflows/build.yml | head -40 ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 55 --- 🏁 Script executed: ```shell # Check if there are any build artifacts or examples showing actual filenames find . -name "*.dmg" -o -name "*darwin*" -o -name "*mac*" 2>/dev/null | grep -i artifact | head -20 ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 55 --- 🏁 Script executed: ```shell # Search for electron-builder configuration and ${os} variable usage rg -n '\$\{os\}' --type json --type js ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 520 --- 🏁 Script executed: ```shell # Check the entire mac configuration in package.json cat -n package.json | sed -n '35,75p' ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 1312 --- 🏁 Script executed: ```shell # Look for any build scripts or documentation about artifact naming rg -n 'artifact' package.json ``` Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 455 --- 🌐 Web query: `electron-builder ${os} variable macOS darwin value` πŸ’‘ Result: In electron-builder the ${os} placeholder for macOS equals "darwin". [1][2] Sources: [1] electron-builder docs β€” Configuration / Common Configuration. [2] electron-builder docs (variable substitution summary). --- </details> **Critical artifact naming mismatch: `${os}` resolves to "darwin" but workflow patterns expect "mac".** The `artifactName` change in package.json (line 48) uses `${os}` which electron-builder resolves to `"darwin"` for macOS, producing filenames like `ReticulumMeshChat-v{version}-darwin-universal.dmg`. However, the workflow patterns at lines 86 and 192 expect `dist/*-mac-*.dmg` and `dist/*-mac.dmg` respectively, which will not match the generated artifacts. Either update the artifactName to use a hardcoded "mac" string instead of `${os}`, or update the workflow patterns to expect "darwin-*" for the macOS artifacts. <details> <summary>πŸ€– Prompt for AI Agents</summary> ``` In package.json around line 48, the artifactName uses ${os} which resolves to "darwin" for macOS, but CI workflow patterns expect "mac", causing mismatched artifact names; fix by replacing ${os} with a hardcoded "mac" in artifactName (e.g., ReticulumMeshChat-v${version}-mac-${arch}.${ext}) or alternatively update the workflow glob patterns at the referenced workflow lines to match "darwin" (e.g., change dist/*-mac-*.dmg to dist/*-darwin-*.dmg and dist/*-mac.dmg to dist/*-darwin.dmg) so artifact names and workflow expectations align. ``` </details> <!-- This is an auto-generated comment by CodeRabbit --> βœ… Addressed in commits c95d2fd to d69a3e8
},
"mac": {
"target": "dmg",
"target": {
"target": "dmg",
"arch": [
"universal"
]
},
"identity": null,
"artifactName": "ReticulumMeshChat-v${version}-${os}.${ext}",
"artifactName": "ReticulumMeshChat-v${version}-${os}-${arch}.${ext}",
"extendInfo": {
"NSMicrophoneUsageDescription": "Microphone access is only needed for Audio Calls",
"com.apple.security.device.audio-input": true