@@ -11,6 +11,9 @@ concurrency:
1111 group : ci-${{ github.ref }}
1212 cancel-in-progress : true
1313
14+ env :
15+ RAW_VERSION : ${{ github.ref_name }}
16+
1417jobs :
1518 # -------------------------------------------------------------------------
1619 # Core lint-and-test matrix (orchestrator + driver)
@@ -303,8 +306,55 @@ jobs:
303306 if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && vars.PUBLISH_GO_APP == 'true'
304307 permissions :
305308 contents : write
306- env :
307- RAW_VERSION : ${{ github.ref_name }}
309+ steps :
310+ - name : Checkout Code
311+ uses : actions/checkout@v4
312+ with :
313+ fetch-depth : 0
314+
315+ - name : Set up Go
316+ uses : actions/setup-go@v5
317+ with :
318+ go-version : ' 1.26.x'
319+
320+ - name : Set up Node.js
321+ uses : actions/setup-node@v4
322+ with :
323+ node-version : ' 20'
324+
325+ # Installs wixl (msitools) onto Ubuntu to compile the .msi package natively
326+ - name : Install MSI Packing Tooling
327+ run : sudo apt-get update && sudo apt-get install -y msitools
328+
329+ - name : Run GoReleaser
330+ uses : goreleaser/goreleaser-action@v6
331+ with :
332+ distribution : goreleaser
333+ version : latest
334+ args : release --clean --config qpi-ui/pkg/.goreleaser.yaml
335+ env :
336+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
337+
338+ # Compiles the real .msi Windows package from GoReleaser's output binary
339+ - name : Package Windows MSI Installer
340+ run : |
341+ VERSION="${RAW_VERSION#v}"
342+ sed -i "s/Version=\"[^\"]*\"/Version=\"${VERSION}\"/" qpi-ui/pkg/qpi.wxs
343+ wixl -v qpi-ui/pkg/qpi.wxs -o dist/qpi_windows_amd64.msi
344+
345+ # Appends the new MSI installer asset into the active GitHub release draft
346+ - name : Upload Windows MSI to Release
347+ uses : softprops/action-gh-release@v3
348+ with :
349+ files : dist/qpi_windows_amd64.msi
350+
351+ # Independent job to build the official Mac installer natively
352+ package-macos-pkg :
353+ needs : [publish-go-release]
354+ runs-on : macos-latest
355+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && vars.PUBLISH_GO_APP == 'true'
356+ permissions :
357+ contents : write
308358 steps :
309359 - name : Checkout Code
310360 uses : actions/checkout@v4
@@ -314,20 +364,25 @@ jobs:
314364 with :
315365 go-version : ' 1.26.x'
316366
317- - name : Install zip utility
318- run : sudo apt-get update && sudo apt-get install -y zip
367+ - name : Set up Node.js
368+ uses : actions/setup-node@v4
369+ with :
370+ node-version : ' 20'
319371
320- - name : Generate Changelog
372+ - name : Build Dashboard & Mac Binary
321373 run : |
322- VERSION=${RAW_VERSION#v}
323- awk -v ver="$VERSION" '/^## \[/ { if ($0 ~ "^## \\[" ver "\\]") { flag=1; next } else { flag=0 } } flag' CHANGELOG.md > ${{ github.workspace }}-CHANGELOG.txt
374+ cd qpi-ui/internal/dashboard && npm ci && npm run build && cd ../..
375+ cd qpi-ui && GOOS=darwin GOARCH=amd64 go build -o ../qpi .
324376
325- - name : Build Packages
377+ # Uses Apple's built-in tool suite to build the native component installer
378+ - name : Build Native macOS .pkg
326379 run : |
327- make package VERSION=${RAW_VERSION#v}
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
328384
329- - name : Upload Binaries to Release
385+ - name : Upload macOS PKG to Release
330386 uses : softprops/action-gh-release@v3
331387 with :
332- files : bin/dist/*
333- body_path : ${{ github.workspace }}-CHANGELOG.txt
388+ files : qpi_macos_amd64.pkg
0 commit comments