Skip to content

Align dev-cli workflow implementation with timewarp-amuru and timewarp-components #25

Description

@StevenTCramer

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 GeneratePackageOnBuildartifacts/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_requestpr
    • pushmerge
    • release / workflow_dispatchrelease
  • 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)
  • PackageOutputPathartifacts/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

  • dev workflow --mode pr runs full PR pipeline including check-version
  • dev workflow --mode release builds package to artifacts/packages/TimeWarp.Terminal.{version}.nupkg and pushes to NuGet.org with --api-key
  • dev workflow auto-detects mode from GITHUB_EVENT_NAME in CI
  • No ad-hoc HTTP NuGet version check in workflow — use ganda repo check-version
  • No explicit dotnet pack step in release pipeline
  • GitHub Actions workflow unchanged (already correct)
  • Local verification documented in issue/PR

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions