Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
70c8f6d
Update installer.nsi
PoctorDepper Jul 27, 2026
ddf74e4
add repository checkout and godot install
PoctorDepper Aug 13, 2026
710fe32
remove .universal
PoctorDepper Aug 13, 2026
4005a90
split mac and windows build
PoctorDepper Aug 13, 2026
7063d5d
install permissions
PoctorDepper Aug 13, 2026
ff4d18a
add Godot build and artifact upload
PoctorDepper Aug 13, 2026
e810dfe
fix project.godot path
PoctorDepper Aug 13, 2026
aa81327
update build path
PoctorDepper Aug 13, 2026
76790ad
switch to single environment for testing
PoctorDepper Aug 13, 2026
d3e91ae
test job modularity
PoctorDepper Aug 13, 2026
740c919
add --quit option to end task
PoctorDepper Aug 14, 2026
1e07c2b
rearrange jobs
PoctorDepper Aug 14, 2026
f916856
update template install step
PoctorDepper Aug 14, 2026
cf1709c
make parent directories
PoctorDepper Aug 14, 2026
59072df
initiate build directory
PoctorDepper Aug 15, 2026
6102b4c
refactor with matrix strategy (again)
PoctorDepper Aug 15, 2026
0296b4d
adjust export directory
PoctorDepper Aug 15, 2026
6b560be
fix matrix error
PoctorDepper Aug 15, 2026
a8934ba
add RELEASE.md for automation
PoctorDepper Aug 15, 2026
e138984
fix publishing permissions
PoctorDepper Aug 15, 2026
1ff74c6
make Kintsugi3DViewer.console.exe optional for build automation
PoctorDepper Aug 15, 2026
937888f
cleanup for main
PoctorDepper Aug 15, 2026
1272ce0
remove console export
PoctorDepper Aug 15, 2026
caa1500
adjust build expression for pull requests
PoctorDepper Aug 21, 2026
be406b7
Merge branch 'main' into build-automation
kaelie-tetzlaff Oct 14, 2026
149b28b
Merge branch 'main' into uninstall-cache
kaelie-tetzlaff Oct 14, 2026
6d29ff6
Merge branch 'main' into build-automation
kaelie-tetzlaff Oct 17, 2026
9087e07
Trying to adjust build script to align with what Kintsugi 3D Builder …
kaelie-tetzlaff Oct 19, 2026
c3300a8
Change releases to draft rather than published on tag push, and (hope…
kaelie-tetzlaff Oct 20, 2026
8c06e46
Merge branch 'build-automation' into uninstall-cache
kaelie-tetzlaff Oct 20, 2026
b691afa
Slight tweaks to language in uninstaller script.
kaelie-tetzlaff Oct 20, 2026
5d8de6c
Try to add some basic smoke tests for MacOS and Windows
kaelie-tetzlaff Oct 20, 2026
ce24b46
NSIS installer needs to check out repository, also improved output me…
kaelie-tetzlaff Oct 21, 2026
2c10791
Try to remove overhead of build artifacts that are stored between jobs.
kaelie-tetzlaff Oct 21, 2026
0cfaced
Attempt to fix build errors
kaelie-tetzlaff Oct 21, 2026
3e5facc
Debugging Windows builds.
kaelie-tetzlaff Oct 21, 2026
f54887d
Try to make Windows wait for Godot to finish executing.
kaelie-tetzlaff Oct 21, 2026
c9918b8
Attempt to make Windows wait for Godot to finish without losing outpu…
kaelie-tetzlaff Oct 21, 2026
d8a4683
Check out a specific revision in the build script.
kaelie-tetzlaff Oct 21, 2026
42dcfdb
Allow manual workflow dispatch for build automation.
kaelie-tetzlaff Oct 21, 2026
f9134e8
Run build automation on pushes to all branches.
kaelie-tetzlaff Oct 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
277 changes: 277 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
name: Build

on:
workflow_dispatch:
push:
branches: [ '**' ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ 'main' ]

env:
godot-version: 4.5
windows-installer-name: Kintsugi3DViewer-windows-installer.exe
windows-name: Kintsugi3DViewer-windows.zip
macos-name: Kintsugi3DViewer-macos.zip

jobs:
prepare-release:
name: Prepare draft release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
if: github.ref_type == 'tag'
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- name: Create draft release if needed
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! gh release view "${{ github.ref_name }}" >/dev/null 2>&1; then
gh release create "${{ github.ref_name }}" \
--title "${{ github.ref_name }}" \
--notes-file RELEASE.md \
--draft
fi

windows:
name: Windows build and tests
runs-on: windows-latest
needs: [ 'prepare-release']
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- name: Install Godot
shell: pwsh
run: |
curl.exe -L -o godot.zip "https://github.com/godotengine/godot/releases/download/${{ env.godot-version }}-stable/Godot_v${{ env.godot-version }}-stable_win64.exe.zip"
Expand-Archive godot.zip -DestinationPath godot
Move-Item "godot/Godot_v${{ env.godot-version }}-stable_win64.exe" Godot.exe

- name: Install Godot export templates
shell: pwsh
run: |
curl.exe -L -o godot-templates.zip "https://github.com/godotengine/godot/releases/download/${{ env.godot-version }}-stable/Godot_v${{ env.godot-version }}-stable_export_templates.tpz"
Expand-Archive godot-templates.zip -DestinationPath godot-templates

$templateDir = "$env:APPDATA/Godot/export_templates/${{ env.godot-version }}.stable"
New-Item -ItemType Directory -Force -Path $templateDir | Out-Null
Copy-Item godot-templates/templates/* $templateDir -Recurse -Force

- name: Update project imports
run: ./Godot.exe --headless --import --verbose | Out-Host

- name: Build project
shell: pwsh
run: |
$output = Join-Path $PWD "export/Kintsugi3DViewer.exe"
New-Item -ItemType Directory -Force export | Out-Null
./Godot.exe --headless --path . --export-release "Windows Desktop (with environments)" "$output" --verbose | Out-Host
$code = $LASTEXITCODE
Write-Host "Godot exit code: $code"
if (!(Test-Path $output -PathType Leaf)) {
throw "Godot did not create the executable at: $output"
}
if ($code -ne 0) {
throw "Godot export failed with exit code $code"
}

- name: Package Windows ZIP
shell: pwsh
run: Compress-Archive -Path "export/Kintsugi3DViewer.exe" -DestinationPath "${{ env.windows-name }}"

- name: Install NSIS
shell: pwsh
run: |
choco install nsis --yes --no-progress
"C:\Program Files (x86)\NSIS" >> $env:GITHUB_PATH

- name: Build NSIS installer
run: makensis -V3 installer.nsi

- name: Smoke test Windows ZIP
shell: pwsh
run: |
Expand-Archive "${{ env.windows-name }}" -DestinationPath extracted

$exe = Join-Path $PWD "extracted/Kintsugi3DViewer.exe"
if (!(Test-Path $exe)) {
throw "Executable missing from ZIP."
}

$p = Start-Process -FilePath $exe -WorkingDirectory (Split-Path $exe) -PassThru
Start-Sleep -Seconds 30
$p.Refresh()

if ($p.HasExited) {
throw "App failed to launch or exited within 30 seconds with code $($p.ExitCode)."
}

Write-Host "App remained open for 30 seconds."
Stop-Process -Id $p.Id -Force

- name: Install application
shell: pwsh
run: |
$installer = Join-Path $PWD "export/${{ env.windows-installer-name }}"
if (!(Test-Path $installer)) {
throw "Installer missing: $installer"
}

$installDir = Join-Path $env:RUNNER_TEMP "Kintsugi3DViewer"
$p = Start-Process -FilePath $installer `
-ArgumentList "/S", "/D=$installDir" -Wait -PassThru

if ($p.ExitCode -ne 0) {
throw "Installer exited with code $($p.ExitCode)."
}

$exe = Join-Path $installDir "Kintsugi3DViewer.exe"
if (!(Test-Path $exe)) {
throw "Installed executable missing."
}

$uninstaller = Join-Path $installDir "uninstall.exe"
if (!(Test-Path $uninstaller)) {
throw "Uninstaller missing."
}

"INSTALL_DIR=$installDir" >> $env:GITHUB_ENV

- name: Smoke test installed executable
shell: pwsh
run: |
$exe = Join-Path $env:INSTALL_DIR "Kintsugi3DViewer.exe"
$p = Start-Process -FilePath $exe `
-WorkingDirectory $env:INSTALL_DIR -PassThru

Start-Sleep -Seconds 30
$p.Refresh()

if ($p.HasExited) {
throw "App failed to launch or exited within 30 seconds with code $($p.ExitCode)."
}

Stop-Process -Id $p.Id -Force
Write-Host "App remained open for 30 seconds."

- name: Uninstall application
shell: pwsh
run: |
$uninstaller = Join-Path $env:INSTALL_DIR "uninstall.exe"
$p = Start-Process -FilePath $uninstaller `
-ArgumentList "/S" -Wait -PassThru

if ($p.ExitCode -ne 0) {
throw "Uninstaller exited with code $($p.ExitCode)."
}

if (Test-Path (Join-Path $env:INSTALL_DIR "Kintsugi3DViewer.exe")) {
throw "Application executable still exists after uninstall."
}

Write-Host "App successfully uninstalled."

- name: Upload Windows release assets
if: github.ref_type == 'tag'
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ github.ref_name }}" \
"${{ env.windows-name }}" \
"export/${{ env.windows-installer-name }}" \
--clobber

macos:
name: macOS build and tests
runs-on: macos-latest
needs: [ 'prepare-release' ]
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- name: Install Godot
run: |
curl -L -o godot.zip "https://github.com/godotengine/godot/releases/download/${{ env.godot-version }}-stable/Godot_v${{ env.godot-version }}-stable_macos.universal.zip"
unzip -q godot.zip

- name: Install Godot export templates
run: |
curl -L -o godot-templates.zip "https://github.com/godotengine/godot/releases/download/${{ env.godot-version }}-stable/Godot_v${{ env.godot-version }}-stable_export_templates.tpz"
unzip -q godot-templates.zip
mkdir -p ~/Library/Application\ Support/Godot/export_templates/${{ env.godot-version }}.stable/
mv ./templates/* ~/Library/Application\ Support/Godot/export_templates/${{ env.godot-version }}.stable/

- name: Update project imports
run: ./Godot.app/Contents/MacOS/Godot --headless --import --verbose

- name: Build project
run: |
mkdir -p export
./Godot.app/Contents/MacOS/Godot --headless --path . --export-release "macOS (all environments)" "export/${{ env.macos-name }}" --verbose

- name: Extract macOS ZIP
run: unzip -q "export/${{ env.macos-name }}" -d extracted

- name: Install timeout utility
run: brew install coreutils

- name: Smoke-test macOS app
shell: bash
run: |
APP="extracted/Kintsugi 3D Viewer.app"
EXE="$APP/Contents/MacOS/Kintsugi 3D Viewer"

# Test 1: Run the executable directly and check whether it exits early.
"$EXE" &
PID=$!
sleep 30

if kill -0 "$PID" 2>/dev/null; then
kill "$PID"
wait "$PID" 2>/dev/null || true
echo "App remained open for 30 seconds (direct executable launch)."
else
if wait "$PID"; then
STATUS=0
else
STATUS=$?
fi
echo "App failed to launch or exited within 30 seconds with code $STATUS (direct executable launch)."
exit 1
fi

# Test 2: Launch as a user would and require it to remain open for 30 seconds.
Gtimeout="$(brew --prefix coreutils)/bin/gtimeout"
set +e
"$Gtimeout" --kill-after=5s 30s open -W -n "$APP"
STATUS=$?
set -e

if [ "$STATUS" -eq 124 ]; then
echo "App remained open for 30 seconds (app launched with 'open')."
else
echo "App failed to launch or exited within 30 seconds with code $STATUS (app launched with 'open')."
exit 1
fi

- name: Upload macOS release asset
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ github.ref_name }}" "export/${{ env.macos-name }}" --clobber
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Kintsugi3DViewer
62 changes: 59 additions & 3 deletions installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Name "Kintsugi 3D Viewer"
RequestExecutionLevel admin
Unicode True
ManifestDPIAware True
OutFile "export/Kintsugi3DViewer-setup.exe"
OutFile "export/Kintsugi3DViewer-windows-installer.exe"

InstallDir $PROGRAMFILES64\Kintsugi3DViewer

Expand All @@ -33,8 +33,15 @@ InstallDir $PROGRAMFILES64\Kintsugi3DViewer
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

; Variables to store uninstall choices
Var Checkbox_ClearViewerCache
Var Checkbox_ClearViewerPreferences
Var ClearViewerCache
Var ClearViewerPreferences

; Uninstaller Pages
!insertmacro MUI_UNPAGE_CONFIRM
UninstPage custom un.CachePageCreate un.CachePageLeave
!insertmacro MUI_UNPAGE_INSTFILES

; Language Files
Expand All @@ -50,7 +57,7 @@ Section "Kintsugi 3D Viewer (required)" SectionApp

SetOutPath $INSTDIR
File "export\Kintsugi3DViewer.exe"
File "export\Kintsugi3DViewer.console.exe"
;File "export\Kintsugi3DViewer.console.exe"
;File "export\Kintsugi3DViewer.pck"
File "README.md"

Expand Down Expand Up @@ -116,6 +123,17 @@ Section "Uninstall"
RMDir /r "$SMPROGRAMS\Kintsugi3DViewer"
RMDir /r "$INSTDIR"

; Remove viewer cache
${If} $ClearViewerCache == 1
RMDir /r "$APPDATA\Kintsugi 3D Viewer\cache"
RMDir /r "$APPDATA\Kintsugi 3D Viewer\shader_cache"
${EndIf}

; Remove viewer preferences (will also remove cache)
${If} $ClearViewerPreferences == 1
RMDir /r "$APPDATA\Kintsugi 3D Viewer"
${EndIf}

; Remove Desktop Shortcut
Delete "$DESKTOP\Kintsugi 3D Viewer.lnk"

Expand All @@ -139,6 +157,44 @@ Function LaunchLink

FunctionEnd

; Options for uninstalling cache directories
Function un.CachePageCreate
; Create the page
nsDialogs::Create 1018

; Set Page Header Text
!insertmacro MUI_HEADER_TEXT "Additional Directories" "Choose which additional software directories to remove."

${NSD_CreateCheckbox} 10u 10u 100% 12u "Clear Kintsugi 3D Viewer preferences, logs, and local files list"
Pop $Checkbox_ClearViewerPreferences
${NSD_Check} $Checkbox_ClearViewerPreferences
${NSD_OnClick} $Checkbox_ClearViewerPreferences un.OnViewerPreferences

${NSD_CreateCheckbox} 10u 25u 100% 12u "Clear Kintsugi 3D Viewer cache"
Pop $Checkbox_ClearViewerCache
${NSD_Check} $Checkbox_ClearViewerCache

; Display the configured page
nsDialogs::Show
FunctionEnd

; Force clearing preferences to clear cache as well
Function un.OnViewerPreferences
Pop $0
${NSD_GetState} $Checkbox_ClearViewerPreferences $0
${If} $0 == 1
${NSD_Check} $Checkbox_ClearViewerCache
${Else}
${NSD_Uncheck} $Checkbox_ClearViewerCache
${EndIf}
FunctionEnd

; Read checkbox states
Function un.CachePageLeave
${NSD_GetState} $Checkbox_ClearViewerCache $ClearViewerCache
${NSD_GetState} $Checkbox_ClearViewerPreferences $ClearViewerPreferences
FunctionEnd

; Init function, read previous installation directory
Function .onInit

Expand All @@ -163,4 +219,4 @@ LangString DESC_SectionDesktop ${LANG_ENGLISH} "Add a shortcut to Kintsugi 3D Vi
!insertmacro MUI_DESCRIPTION_TEXT ${SectionAssociation} $(DESC_SectionAssociation)
!insertmacro MUI_DESCRIPTION_TEXT ${SectionShortcut} $(DESC_SectionShortcut)
!insertmacro MUI_DESCRIPTION_TEXT ${SectionDesktop} $(DESC_SectionDesktop)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Loading