Enhance build configuration for macOS and update artifact naming #22
19
.github/workflows/build.yml
vendored
@@ -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:
|
||||
|
|
||||
@@ -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
|
||||
|
||||
|
||||
14
package.json
@@ -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"
|
||||
},
|
||||
|
β οΈ Potential issue | π Major New Three distribution scripts now exist:
The workflow always calls Either:
If option 1, update
π€ Prompt for AI Agents_β οΈ 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"
|
||||
|
β οΈ Potential issue | π΄ Critical π§© Analysis chainπ Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 55 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 91 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 100 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 55 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 145 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 789 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 91 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 1127 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 561 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 55 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 55 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 520 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 1312 π Script executed: Repository: Sudo-Ivan/reticulum-meshchatX Length of output: 455 π Web query:
π‘ Result: In electron-builder the ${os} placeholder for macOS equals "darwin". [1][2] Sources: Critical artifact naming mismatch: The π€ Prompt for AI Agents_β οΈ 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}-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
|
||||
|
||||
β οΈ Potential issue | π Major
Artifact upload pattern may not match generated filenames with architecture suffix.
The
release_artifactspattern at line 86 was updated todist/*-mac-*.dmg(to account for architecture), but the artifact upload at line 192 still uses the old patterndist/*-mac.dmg. The newartifactNamein package.json includes${arch}, so generated files will be named likeReticulumMeshChat-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:
Also applies to: 192-192
π€ Prompt for AI Agents
β Addressed in commits
c95d2fdtod69a3e8