Skip to content

Commit 29ea2d6

Browse files
authored
docs(warp): update WARP.md to reflect CI changes, Windows EXE stubs flow, tests and repo map (#102)
1 parent bc7b663 commit 29ea2d6

File tree

1 file changed

+47
-28
lines changed

1 file changed

+47
-28
lines changed

WARP.md

Lines changed: 47 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,40 @@ Scope: whole repository (DotnetPackaging).
66

77
CI pipeline (Azure Pipelines)
88
- Definition: azure-pipelines.yml at repo root.
9-
- Agent: ubuntu-latest.
10-
- Tools: installs DotnetDeployer.Tool globally.
11-
- Behavior by branch:
12-
- master: packs and pushes all packable projects to NuGet via dotnetdeployer nuget --api-key $(NuGetApiKey)
13-
- other branches and PRs: dry run (packs but does not push) via --no-push
14-
- Packable projects: every project with IsPackable/PackAsTool set. This includes the CLI tool (src/DotnetPackaging.Console), since PackAsTool=true and it is part of the solution.
9+
- Agent: windows-latest.
10+
- Versioning: computed with GitVersion.Tool; packages use MajorMinorPatch as Version; GitHub Release tag uses v{SemVer}.
11+
- Behavior on master:
12+
- Restore, build and pack all projects; push .nupkg (non-symbol) to NuGet (skip-duplicate) with $(NuGetApiKey).
13+
- Publish Windows EXE stubs (DotnetPackaging.Exe.Installer) for win-x64 and win-arm64 as single-file self-extract apps (IncludeNativeLibrariesForSelfExtract/IncludeAllContentForSelfExtract, no trimming).
14+
- Produce .sha256 for each stub and upload both .exe and .sha256 to a GitHub Release tagged v{SemVer} using gh CLI.
15+
- Other branches/PRs: build and pack only (no push, no release).
16+
- Packable projects: every project with IsPackable/PackAsTool set. The CLI tool lives in src/DotnetPackaging.Tool (PackAsTool=true).
1517

1618
Versioning (GitVersion)
17-
- DotnetDeployer determines the version primarily using GitVersion (NuGetVersion or MajorMinorPatch).
18-
- If GitVersion is unavailable, the tool falls back to git describe --tags --long and converts it to a NuGet-compatible version.
19-
- Practical effect: merging a PR into master automatically triggers a publish with the GitVersion-computed version.
19+
- GitVersion.Tool runs in CI to produce:
20+
- Version: MajorMinorPatch (used for dotnet build/pack).
21+
- TagName: v{SemVer} (used to create/update the GitHub Release).
22+
- Practical effect: merging to master triggers package publish to NuGet and stub upload to a GitHub Release for the computed tag.
2023

2124
Secrets
2225
- The pipeline expects a variable group named api-keys providing:
23-
- NuGetApiKey: API key used by dotnetdeployer to push packages.
24-
- Do not hardcode secrets. Locally, export environment variables and pass them to the tool.
26+
- NuGetApiKey: API key used to push packages to NuGet.
27+
- GitHubApiKey: token exposed as GITHUB_TOKEN to create/update releases and upload stub assets via gh.
28+
- Do not hardcode secrets. Locally, export environment variables and pass them to the CLI tools.
2529

2630
Local replication
27-
- Install tool: dotnet tool install --global DotnetDeployer.Tool
28-
- Dry run (no push): dotnetdeployer nuget --api-key "$NUGET_API_KEY" --no-push
29-
- Real publish (imitates master): dotnetdeployer nuget --api-key "$NUGET_API_KEY"
31+
- Pack locally:
32+
- dotnet restore
33+
- dotnet build -c Release -p:ContinuousIntegrationBuild=true -p:Version=1.2.3 --no-restore
34+
- dotnet pack -c Release --no-build -p:IncludeSymbols=false -p:SymbolPackageFormat=snupkg -p:Version=1.2.3 -o ./artifacts/nuget
35+
- Push to NuGet:
36+
- For each .nupkg (non-symbol): dotnet nuget push ./artifacts/nuget/<pkg>.nupkg --api-key "$env:NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate
37+
- Build Windows stubs (on Windows):
38+
- dotnet publish src/DotnetPackaging.Exe.Installer/DotnetPackaging.Exe.Installer.csproj -c Release -r win-x64 -p:PublishSingleFile=true -p:SelfContained=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true -p:PublishTrimmed=false -o ./artifacts/stubs/win-x64
39+
- Repeat for win-arm64 by changing -r.
40+
- Release (optional):
41+
- gh release create v1.2.3 --title "DotnetPackaging 1.2.3" --notes "Local release"
42+
- gh release upload v1.2.3 ./artifacts/stubs/win-*/DotnetPackaging.Exe.Installer*.exe ./artifacts/stubs/win-*/DotnetPackaging.Exe.Installer*.exe.sha256 -R <owner>/<repo>
3043

3144
Notes
3245
- Because the CLI is a dotnet tool (PackAsTool=true) and is included in the solution, CI will pack and publish it to NuGet alongside the libraries when running on master.
@@ -66,9 +79,9 @@ Packaging formats: status and details
6679
- Windows EXE (.exe) — preview
6780
- Status: preview. Dotnet-only SFX builder. Library: src/DotnetPackaging.Exe. Stub Avalonia: src/DotnetPackaging.Exe.Installer (esqueleto WIP).
6881
- How it works: produces a self-extracting installer by concatenating [stub.exe][payload.zip][Int64 length]["DPACKEXE1"]. The payload contains metadata.json and Content/ (publish output). The stub leerá metadata y realizará la instalación.
69-
- CLI: exe (desde carpeta publish) y exe from-project (publica y empaqueta). --stub es opcional: si el repo está presente, el stub se publica automáticamente por RID; si no, puede pasarse manualmente.
82+
- CLI: exe (desde carpeta publish) y exe from-project (publica y empaqueta). Si omites --stub, el packer descargará automáticamente el stub que corresponda desde GitHub Releases; puedes pasar --stub para forzar uno concreto.
7083
- Cross-platform build: el empaquetado (concatenación) funciona desde cualquier SO. El stub se publica por RID (win-x64/win-arm64).
71-
- Defaults: self-contained=true al generar desde proyecto; RID obligatorio en hosts no Windows (para auto-publicar el stub).
84+
- Defaults: self-contained=true al generar desde proyecto; en hosts no Windows, especifica --rid (win-x64/win-arm64) para elegir el stub/target correcto.
7285

7386
CLI tool (dotnet tool)
7487
- Project: src/DotnetPackaging.Tool (PackAsTool=true, ToolCommandName=dotnetpackaging).
@@ -83,7 +96,7 @@ CLI tool (dotnet tool)
8396
- flatpak from-project: publish a .NET project and build a .flatpak bundle.
8497
- msix (experimental): msix pack (from directory) and msix from-project.
8598
- dmg (experimental): dmg (from directory) and dmg from-project (publishes then builds a .dmg).
86-
- exe (preview): Windows self-extracting installer (.exe) from directory; and exe from-project (publica y empaqueta). Requiere --stub por ahora.
99+
- exe (preview): Windows self-extracting installer (.exe) from directory; and exe from-project (publica y empaqueta). Si omites --stub, se descargará el stub apropiado automáticamente.
87100
- Common options (all commands share a metadata set):
88101
- --directory <dir> (required): input directory to package from.
89102
- --output <file> (required): output file (.AppImage, .deb, .rpm, .msix, .flatpak, .dmg).
@@ -114,19 +127,21 @@ Tests
114127
- Integration tests covering metadata and tar entries layout.
115128
- MSIX tests (src/DotnetPackaging.Msix.Tests):
116129
- Validate building MSIX and unpacking with makeappx to assert structure.
130+
- EXE tests (test/DotnetPackaging.Exe.Tests):
131+
- Validate metadata zip creation and concatenation format; basic install path resolution.
117132
- Gaps / TODOs:
118-
- Add CLI end-to-end tests (invocation of dotnetpackaging appimage/deb on temp publishes and validating outputs).
119-
- Integrate dotnet test into azure-pipelines.yml (currently only packaging/publish runs).
120-
- Expose msix in CLI and add corresponding tests.
133+
- Add CLI end-to-end tests (invocation of dotnetpackaging appimage/deb/rpm/exe on temp publishes and validating outputs).
134+
- Integrate dotnet test into azure-pipelines.yml.
135+
- Improve EXE installer UI and add Windows E2E tests.
121136

122137
Developer workflow tips
123138
- Publish input
124139
- AppImage/Deb/RPM/Flatpak/MSIX consume a folder produced by dotnet publish. from-project subcommands invoke a minimal publisher and reuse the same pipelines.
125140
- For AppImage, ensure an ELF executable is present (self-contained single-file publish is acceptable). If not specified, the first eligible ELF is chosen.
126141
- RID/self-contained
127142
- from-project defaults:
128-
- rpm/deb/appimage: self-contained=true by default. If running on a non-Linux host, --rid is required (e.g., linux-x64/linux-arm64) to avoid host RID inference.
129-
- msix: self-contained=false by default. If running on a non-Windows host, --rid is required (e.g., win-x64/win-arm64).
143+
- rpm/deb/appimage: self-contained=true by default. RID is optional; if you need to cross-publish (target a different OS/arch than the host), pass --rid (e.g., linux-x64/linux-arm64).
144+
- msix: self-contained=false by default. RID is optional; pass --rid when cross-publishing (e.g., win-x64/win-arm64).
130145
- dmg: requires --rid (osx-x64 or osx-arm64). Host RID inference is intentionally not used to avoid producing non-mac binaries when running on Linux/Windows.
131146
- flatpak: framework-dependent by default; uses its own runtime. You can still publish self-contained by passing --self-contained and --rid if needed.
132147
- RPM prerequisites
@@ -143,23 +158,27 @@ Repository map (relevant)
143158
- src/DotnetPackaging.Deb: Debian packaging (Tar entries, DebFile).
144159
- src/DotnetPackaging.Rpm: RPM packaging (layout builder and rpmbuild spec generation).
145160
- src/DotnetPackaging.Msix: MSIX packaging (builder and helpers).
146-
- src/DotnetPackaging.Tool: CLI (dotnet tool) with commands appimage, deb, rpm, flatpak.
147-
- test/*: AppImage and Deb tests; src/DotnetPackaging.Msix.Tests for MSIX validation.
161+
- src/DotnetPackaging.Exe: Windows SFX packer (concatenation and metadata).
162+
- src/DotnetPackaging.Exe.Installer: Avalonia stub installer.
163+
- src/DotnetPackaging.Tool: CLI (dotnet tool) with commands appimage, deb, rpm, flatpak, msix, exe.
164+
- test/*: AppImage and Deb tests; src/DotnetPackaging.Msix.Tests for MSIX; test/DotnetPackaging.Exe.Tests for EXE packaging.
148165

149166
Backlog / Future work
150-
- Expose msix as a first-class command in the CLI.
151-
- Add CLI E2E tests (including rpm) and hook dotnet test in CI.
167+
- Add CLI E2E tests (including rpm/exe) and hook dotnet test in CI.
152168
- Optional: enrich icon detection strategies and metadata mapping (e.g., auto-appId from name + reverse DNS).
153169

154170
Windows EXE (.exe) – progress log (snapshot)
155171
- Done:
156172
- Librería DotnetPackaging.Exe con SimpleExePacker (concatena stub + zip + footer).
157-
- Comandos CLI: exe (desde carpeta) y exe from-project (publica y empaqueta), ambos requieren --stub por ahora.
173+
- Comandos CLI: exe (desde carpeta) y exe from-project (publica y empaqueta). --stub es opcional; si se omite, el packer descarga el stub que corresponda desde GitHub Releases.
158174
- Stub Avalonia creado (esqueleto) en src/DotnetPackaging.Exe.Installer con lector de payload.
175+
- Instalador: opción de crear acceso directo en Escritorio en el paso Finish; acceso directo en Start Menu se mantiene.
176+
- CI: publica stubs win-x64 y win-arm64 como single-file self-extract con hashes y los sube a un GitHub Release (tag v{SemVer}).
177+
- Packer: logging antes de descargar el stub para informar del tiempo de espera.
159178
- Next:
160179
- UI: Integrar SlimWizard de Zafiro en el stub (ahora hay UI mínima). Navegación con WizardNavigator y páginas.
161180
- Lógica: Elevación UAC y carpeta por defecto en Program Files según arquitectura.
162-
- Packer: Publicar stub por RID automáticamente desde el packer (evitar --stub manual).
181+
- Packer: caché local de stubs y reintentos/validación de hashes.
163182
- Detección avanzada de ejecutable e icono (paridad con .deb/.appimage).
164183
- Modo silencioso.
165184
- Pruebas E2E en Windows.

0 commit comments

Comments
 (0)