Summary
The GitHub Actions workflow (.github/workflows/workflow.yml) already matches the standard TimeWarp pattern — OIDC NuGet login, single dev workflow invocation, artifact upload. However, tools/dev-cli/endpoints/workflow.cs diverges from the canonical implementation used in timewarp-amuru and newly aligned timewarp-components.
We should update the dev-cli workflow command so all library repos share the same CI/CD orchestration pattern.
Current divergence
| Aspect |
timewarp-amuru / timewarp-components |
timewarp-terminal (current) |
| Mode detection |
--mode flag (pr, merge, release) + GITHUB_EVENT_NAME auto-detect |
GITHUB_EVENT_NAME + --api-key presence only |
| PR/merge pipeline |
clean → build → verify-samples → test → check-version |
clean → build → verify-samples → test (no check-version) |
| Release pipeline |
clean → build → push |
clean → build → check-version → pack → push |
| Package creation |
GeneratePackageOnBuild → artifacts/packages/ during build |
explicit dotnet pack step in release workflow |
| Version check |
ganda repo check-version --strategy git-tag via check-version command |
ad-hoc HTTP GET to NuGet.org flat container API |
| Implementation style |
sub-command handlers (CleanCommand, BuildCommand, etc.) |
inline dotnet shell calls |
Reference implementations
timewarp-amuru/tools/dev-cli/endpoints/workflow-command.cs
timewarp-components/tools/dev-cli/endpoints/workflow-command.cs (recently aligned)
timewarp-components/kanban/done/001-update-dev-cli-workflow-to-publish-the-library.md (documents the divergence and verification steps)
Proposed changes
1. Add check-version dev-cli command
Add tools/dev-cli/endpoints/check-version.cs delegating to ganda repo check-version --strategy git-tag (same as amuru/components).
2. Rewrite workflow.cs to match canonical pattern
- Add
--mode / -m option and CiMode enum (Pr, Merge, Release)
- Auto-detect mode from
GITHUB_EVENT_NAME when --mode is not specified:
pull_request → pr
push → merge
release / workflow_dispatch → release
- PR/merge pipeline: invoke sub-command handlers for
clean → build → verify-samples → test → check-version
- Release pipeline:
clean → build → push via PushPackageAsync for TimeWarp.Terminal.{version}.nupkg
- Keep existing
--api-key option for OIDC Trusted Publishing
3. Align MSBuild packaging
Ensure packages are produced during Release build (not a separate dotnet pack step):
GeneratePackageOnBuild=true in source/Directory.Build.props (or equivalent scoped location)
PackageOutputPath → artifacts/packages/
timewarp-terminal already has PackageOutputPath in root Directory.Build.props and IsPackable=true on the library project — verify build produces the .nupkg and remove the explicit pack step from the release workflow.
4. Refactor to handler-based orchestration
Replace inline Shell.Builder("dotnet") calls in workflow.cs with handler invocations for existing commands (build.cs, test.cs, verify-samples.cs) plus new clean and check-version commands if not already present.
Acceptance criteria
Notes
- NuGet publisher:
TimeWarp.Enterprises
- GitHub workflow file does not need changes — only dev-cli orchestration
workflow_dispatch should map to release mode (consistent with amuru/components)
Summary
The GitHub Actions workflow (
.github/workflows/workflow.yml) already matches the standard TimeWarp pattern — OIDC NuGet login, singledev workflowinvocation, artifact upload. However,tools/dev-cli/endpoints/workflow.csdiverges from the canonical implementation used in timewarp-amuru and newly aligned timewarp-components.We should update the dev-cli
workflowcommand so all library repos share the same CI/CD orchestration pattern.Current divergence
--modeflag (pr,merge,release) +GITHUB_EVENT_NAMEauto-detectGITHUB_EVENT_NAME+--api-keypresence onlyclean → build → verify-samples → test → check-versionclean → build → verify-samples → test(nocheck-version)clean → build → pushclean → build → check-version → pack → pushGeneratePackageOnBuild→artifacts/packages/during builddotnet packstep in release workflowganda repo check-version --strategy git-tagviacheck-versioncommandCleanCommand,BuildCommand, etc.)dotnetshell callsReference implementations
timewarp-amuru/tools/dev-cli/endpoints/workflow-command.cstimewarp-components/tools/dev-cli/endpoints/workflow-command.cs(recently aligned)timewarp-components/kanban/done/001-update-dev-cli-workflow-to-publish-the-library.md(documents the divergence and verification steps)Proposed changes
1. Add
check-versiondev-cli commandAdd
tools/dev-cli/endpoints/check-version.csdelegating toganda repo check-version --strategy git-tag(same as amuru/components).2. Rewrite
workflow.csto match canonical pattern--mode/-moption andCiModeenum (Pr,Merge,Release)GITHUB_EVENT_NAMEwhen--modeis not specified:pull_request→prpush→mergerelease/workflow_dispatch→releaseclean → build → verify-samples → test → check-versionclean → build → pushviaPushPackageAsyncforTimeWarp.Terminal.{version}.nupkg--api-keyoption for OIDC Trusted Publishing3. Align MSBuild packaging
Ensure packages are produced during Release build (not a separate
dotnet packstep):GeneratePackageOnBuild=trueinsource/Directory.Build.props(or equivalent scoped location)PackageOutputPath→artifacts/packages/timewarp-terminalalready hasPackageOutputPathin rootDirectory.Build.propsandIsPackable=trueon the library project — verify build produces the.nupkgand remove the explicit pack step from the release workflow.4. Refactor to handler-based orchestration
Replace inline
Shell.Builder("dotnet")calls inworkflow.cswith handler invocations for existing commands (build.cs,test.cs,verify-samples.cs) plus newcleanandcheck-versioncommands if not already present.Acceptance criteria
dev workflow --mode prruns full PR pipeline includingcheck-versiondev workflow --mode releasebuilds package toartifacts/packages/TimeWarp.Terminal.{version}.nupkgand pushes to NuGet.org with--api-keydev workflowauto-detects mode fromGITHUB_EVENT_NAMEin CIganda repo check-versiondotnet packstep in release pipelineNotes
TimeWarp.Enterprisesworkflow_dispatchshould map toreleasemode (consistent with amuru/components)