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 22 additions and 11 deletions

View File

@@ -59,7 +59,7 @@ jobs:
run: npm run build-frontend
- name: Upload frontend artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: frontend-build
path: meshchatx/public
@@ -79,18 +79,21 @@ jobs:
python: "3.12"
release_artifacts: "dist/*-win-installer.exe,dist/*-win-portable.exe"
build_input: build_windows
dist_script: dist-prebuilt
- 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
dist_script: dist:mac-universal
- name: linux
os: ubuntu-latest
node: 22
python: "3.12"
release_artifacts: "dist/*-linux.AppImage,dist/*-linux.deb,python-dist/*.whl"
build_input: build_linux
dist_script: dist-prebuilt
permissions:
contents: write
steps:
coderabbitai[bot] commented 2025-12-01 18:43:12 +00:00 (Migrated from github.com)
Review

⚠️ Potential issue | 🟠 Major

Artifact upload pattern may not match generated filenames with architecture suffix.

The release_artifacts pattern at line 86 was updated to dist/*-mac-*.dmg (to account for architecture), but the artifact upload at line 192 still uses the old pattern dist/*-mac.dmg. The new artifactName in package.json includes ${arch}, so generated files will be named like ReticulumMeshChat-v2.41.0-mac-universal.dmg, which matches the wildcard pattern at line 86 but the upload step at line 192 may not capture them correctly.

Update the artifact upload pattern to include architecture:

         path: |
           dist/*-win-installer.exe
           dist/*-win-portable.exe
-          dist/*-mac.dmg
+          dist/*-mac-*.dmg
           dist/*-linux.AppImage
           dist/*-linux.deb
           python-dist/*.whl

Also applies to: 192-192

πŸ€– Prompt for AI Agents
.github/workflows/build.yml around lines 86 and 192: the release_artifacts
pattern was changed to include an architecture segment (`dist/*-mac-*.dmg` vs
`dist/*-mac.dmg`) but the artifact upload step still uses the old pattern and
will miss files named with `${arch}` (e.g.,
ReticulumMeshChat-v2.41.0-mac-universal.dmg); update the upload step's artifact
file pattern at line 192 to also include the architecture wildcard (e.g., change
`dist/*-mac.dmg` to `dist/*-mac-*.dmg`) and scan the file for any other
occurrences of the old pattern to make them consistent.

βœ… Addressed in commits c95d2fd to d69a3e8

_⚠️ Potential issue_ | _🟠 Major_ **Artifact upload pattern may not match generated filenames with architecture suffix.** The `release_artifacts` pattern at line 86 was updated to `dist/*-mac-*.dmg` (to account for architecture), but the artifact upload at line 192 still uses the old pattern `dist/*-mac.dmg`. The new `artifactName` in package.json includes `${arch}`, so generated files will be named like `ReticulumMeshChat-v2.41.0-mac-universal.dmg`, which matches the wildcard pattern at line 86 but the upload step at line 192 may not capture them correctly. Update the artifact upload pattern to include architecture: ```diff path: | dist/*-win-installer.exe dist/*-win-portable.exe - dist/*-mac.dmg + dist/*-mac-*.dmg dist/*-linux.AppImage dist/*-linux.deb python-dist/*.whl ``` Also applies to: 192-192 <details> <summary>πŸ€– Prompt for AI Agents</summary> ``` .github/workflows/build.yml around lines 86 and 192: the release_artifacts pattern was changed to include an architecture segment (`dist/*-mac-*.dmg` vs `dist/*-mac.dmg`) but the artifact upload step still uses the old pattern and will miss files named with `${arch}` (e.g., ReticulumMeshChat-v2.41.0-mac-universal.dmg); update the upload step's artifact file pattern at line 192 to also include the architecture wildcard (e.g., change `dist/*-mac.dmg` to `dist/*-mac-*.dmg`) and scan the file for any other occurrences of the old pattern to make them consistent. ``` </details> <!-- This is an auto-generated comment by CodeRabbit --> βœ… Addressed in commits c95d2fd to d69a3e8
@@ -150,7 +153,7 @@ jobs:
if: |
github.event_name == 'push' ||
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true)
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: frontend-build
path: meshchatx/public
@@ -173,11 +176,11 @@ 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)
run: npm run dist-prebuilt
run: npm run ${{ matrix.dist_script }}
- name: Upload build artifacts
if: |
@@ -189,7 +192,7 @@ jobs:
path: |
dist/*-win-installer.exe
dist/*-win-portable.exe
dist/*-mac.dmg
dist/*-mac-*.dmg
dist/*-linux.AppImage
dist/*-linux.deb
python-dist/*.whl
@@ -204,7 +207,7 @@ jobs:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
path: artifacts

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,15 @@
"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": {
"target": "dmg",
"arch": [
"universal"
]
},
"identity": null,
"artifactName": "ReticulumMeshChat-v${version}-${os}.${ext}",
"artifactName": "ReticulumMeshChat-v${version}-mac-${arch}.${ext}",
"x64ArchFiles": "Contents/Resources/app/electron/build/exe/**",
"extendInfo": {
"NSMicrophoneUsageDescription": "Microphone access is only needed for Audio Calls",
"com.apple.security.device.audio-input": true