@@ -355,6 +355,14 @@ jobs:
355355 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && vars.PUBLISH_GO_APP == 'true'
356356 permissions :
357357 contents : write
358+ strategy :
359+ matrix :
360+ goarch : ['amd64', 'arm64']
361+ env :
362+ GOARCH : ${{ matrix.goarch }}
363+ ARTEFACT : " qpi_${{ matrix.goarch }}"
364+ OUTPUT_ARTEFACT : " qpi_macos_${{ matrix.goarch }}.pkg"
365+ PKG_ROOT : " pkg_${{ matrix.goarch }}_root"
358366 steps :
359367 - name : Checkout Code
360368 uses : actions/checkout@v4
@@ -369,21 +377,33 @@ jobs:
369377 with :
370378 node-version : ' 22'
371379
372- - name : Build Dashboard & Mac Binary
380+ - name : Build Dashboard
381+ run : make build-dashboard
382+
383+ - name : Build Mac ${{ matrix.goarch }} Binary
373384 run : |
374- cd qpi-ui/internal/dashboard && npm ci && npm run build && cd ../..
375- cd qpi-ui && GOOS=darwin GOARCH=amd64 go build -o ../qpi .
385+ GOOS=darwin go build -C "qpi-ui" -ldflags="-X 'main.Version=v${RAW_VERSION#v}'" -o "../${ARTEFACT}" .
376386
377387 # Uses Apple's built-in tool suite to build the native component installer
378- - name : Build Native macOS .pkg
388+ - name : Build Native ${{ matrix.goarch }} macOS .pkg
379389 run : |
380- mkdir -p pkg_root/usr/local/bin
381- cp qpi pkg_root/usr/local/bin/
382- VERSION="${RAW_VERSION#v}"
383- pkgbuild --identifier "com.sopherapps.qpi" --version "${VERSION}" --install-location "/" --root pkg_root qpi_macos_amd64.pkg
390+ mkdir -p "${PKG_ROOT}/usr/local/bin/"
391+ cp "${ARTEFACT}" "${PKG_ROOT}/usr/local/bin/"
392+ pkgbuild --identifier "com.sopherapps.qpi" --version "${RAW_VERSION#v}" --install-location "/" --root "$PKG_ROOT" "$OUTPUT_ARTEFACT"
384393
385394 - name : Upload macOS PKG to Release
386395 uses : softprops/action-gh-release@v3
387396 with :
388- files : qpi_macos_amd64.pkg
397+ files : ${{ env.OUTPUT_ARTEFACT }}
398+
399+ publish-release :
400+ needs : [package-macos-pkg]
401+ runs-on : ubuntu-latest
402+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && vars.PUBLISH_GO_APP == 'true'
403+ permissions :
404+ contents : write
405+ steps :
406+ - name : Publish Release
407+ uses : softprops/action-gh-release@v3
408+ with :
389409 draft : false
0 commit comments