Commit Graph

15 Commits

Author SHA1 Message Date
chaim 8c583aaa3c ci: single-step build with transcript so logs always upload
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:24:50 +00:00
chaim 63090ce877 ci: capture build output via Tee-Object for artifact retrieval
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:22:17 +00:00
chaim 64a1d63656 ci: dump msbuild log to artifact so we can debug failures via API
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:19:33 +00:00
chaim a8af5e3749 fix(ci): import cert to CurrentUser\My + patch csproj thumbprint
VSTO's ResolveKeySource target reads ManifestCertificateThumbprint
directly from csproj XML (not from /p: overrides) and looks for it
under Cert:\CurrentUser\My (not LocalMachine\My). Import the cert
to CurrentUser\My before build and patch the csproj XML to use the
real Marcus-Law thumbprint instead of VS's temporary-key thumbprint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:17:05 +00:00
chaim 9f595c8ece fix(ci): override ManifestCertificateThumbprint with Marcus-Law cert
VSTO refuses to build with SignManifests=false. Override the project's
hardcoded VS-temporary-key thumbprint with our real code-signing cert
(already imported into LocalMachine\My during runner setup).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:12:52 +00:00
chaim 0e21be21f3 fix(ci): skip compile-time manifest signing (MSB3323)
The legacy VSTO project carries <SignManifests>true</SignManifests> with
a thumbprint pointing to VS's auto-generated temporary key, which exists
on a developer's machine but never on a CI runner. The release manifests
are signed properly in publish-clickonce via mage with the real Marcus-Law
cert, so /p:SignManifests=false at compile time is the right thing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:10:59 +00:00
chaim 399fd24f4d fix(ci): set NUGET_PACKAGES outside system32 (NETSDK1064 fix)
NuGet ignores our service-level USERPROFILE override (it uses
SHGetKnownFolderPath which returns LocalSystem's profile regardless of
the env var) and installs packages to C:\Windows\system32\configsystemprofile\.nuget\packages. 32-bit MSBuild then can't find them because
the Win32 File System Redirector silently shunts system32 paths to
SysWOW64 for 32-bit processes -> NETSDK1064 'package not found'.

NUGET_PACKAGES is NuGet's highest-priority package-folder override and
puts everything outside system32, so both restore and build agree on
paths and the redirector never gets involved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:06:16 +00:00
chaim 55d3e6d0f3 fix(ci): unify restore + build via 'msbuild /restore' (avoid NETSDK1064)
Standalone 'nuget.exe restore' (32-bit) and the subsequent build (which
loads the 64-bit .NET 9 SDK PackageDependencyResolution.targets) disagree
on the resolved package paths, surfacing as NETSDK1064 'Package ... was
not found' on SDK-style projects (OutlookAddin.UI / .Core / .Tests).
Using 'msbuild /restore' keeps both phases in one MSBuild process with a
consistent assets file and package cache lookup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 16:04:00 +00:00
chaim e6c2b099d0 fix(ci): use VS Pro MSBuild (requires Office workload) instead of Build Tools
VS Build Tools 2022 does not ship Microsoft.VisualStudio.Tools.Office.targets
(only the full VS IDE editions do), so the VSTO project fails to import them
(MSB4226). The runner machine already has VS Pro 2022 with the Office workload
installed; switch from microsoft/setup-msbuild@v2 (which picks Build Tools via
-latest) to a manual vswhere step that explicitly requires the Office workload.

Also removes the temporary filesystem-debug step (root cause was the Win32 File
System Redirector pulling system32 paths to SysWOW64 for 32-bit nuget/MSBuild;
fixed at the runner level via USERPROFILE redirect, not in the workflow).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 15:59:50 +00:00
chaim f794fbc37a fix(ci): use Windows PowerShell 5.1 (powershell) instead of pwsh
The self-hosted Windows runner runs as LocalSystem and only sees the
machine PATH. winget-installed pwsh lands in the user PATH and is
invisible to the service. Built-in Windows PowerShell 5.1 (`powershell`)
handles the same syntax we use, so switch all steps to it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 15:45:48 +00:00
chaim 22e556afe0 debug(ci): list filesystem after checkout to diagnose MSB3202
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 15:37:36 +00:00
chaim 033399b21a fix(ci): resolve msbuild/nuget/mage/signtool dynamically
The first v0.1.0 run failed because actions/checkout could not find Node
and msbuild/nuget were never on the LocalSystem PATH after winget install.
This commit pulls in the standard tool-setup actions and resolves the
.NET-Framework-bound tooling (mage.exe, signtool.exe) by walking the
Windows SDK / .NET 4.8 Developer Pack directories instead of hardcoding
versioned paths that drift across machines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 15:16:24 +00:00
chaim 73d6799eb2 feat(ci): CI/CD container delivery for ClickOnce artifacts
Replace direct SSH rsync with build → push to registry → Coolify pull pattern,
matching the rest of the infra (decisions-court, ai-gateway, ...). Adds cdn/
Dockerfile + nginx.conf to serve .vsto/.application/.manifest/.deploy with
correct MIME types behind a StripPrefix Traefik middleware.

The new workflow has three jobs:
- build:               Windows runner, nuget restore + msbuild + dotnet test.
- publish-clickonce:   Windows runner, only on v* tag — sign assemblies +
                       mage manifests + upload publish/ as artifact.
- dockerize-and-deploy: Linux runner — download artifact, build & push
                       outlook-addin-cdn:<version> + :latest to
                       gitea.dev.marcus-law.co.il, then trigger Coolify
                       redeploy of app awdlvjlozz0dvn6kjlme9rd7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 15:10:39 +00:00
PointStar f6d0c2bced ci(publish): Task #8 — fill in ClickOnce publish + rsync + Mattermost
Trigger: tag push v*.

- Compute version from tag (vMAJOR.MINOR.PATCH → 4-part for mage)
- Sign DLLs + exe with signtool (CODESIGN_THUMBPRINT secret)
- Build ClickOnce .dll.manifest + .vsto via mage.exe, sign both, rename
  payload files with .deploy convention for static-file serving
- Stage protocol handler bin/ + install-protocol.ps1 alongside the
  ClickOnce artifact
- Upload publish/ artifact to GH Actions for inspection
- Upload to platform.dev:/var/www/outlook-addin/ via rsync (WSL) with scp
  fallback. PLATFORM_DEV_SSH_KEY secret expects a base64-encoded private
  key. Skips gracefully if the secret is empty.
- POST to MATTERMOST_WEBHOOK_RELEASES on success and failure
  (#git-verelasim channel). Skips gracefully if the secret is empty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 15:53:50 +03:00
chaim cf10db00a3 chore: scaffold Outlook VSTO Add-in for EspoCRM
Initial repo scaffold for a Windows VSTO/COM Outlook Add-in (C#/.NET FW 4.8)
that integrates Outlook desktop with EspoCRM via the existing MailRouter
v1.2.0 endpoint (POST /api/v1/MailRouter/file).

Includes:
- Solution + 4 csproj projects (host, Core, UI, Tests) under src/
- VSTO host project stub (ThisAddIn.cs, requires VS 2022 + Office workload to fully resolve)
- Core/UI/Tests as SDK-style net48 projects (NuGet: Polly, System.Text.Json,
  Serilog, CommunityToolkit.Mvvm, xUnit, Moq, FluentAssertions)
- .gitea/workflows/build.yml for Windows runner CI (publish/sign placeholders)
- docs/ARCHITECTURE.md (component diagram, threading model, per-feature flow)
- docs/ONBOARDING.md (Hebrew lawyer-facing install guide)

Server-side already in place: MailRouter v1.2.0 — see plan
~/.claude/plans/resilient-sauteeing-feather.md for the 6-week implementation
plan.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 09:05:07 +00:00