Skip to content

Add release workflow for versioning and publishing - #107

Merged
Mudaafi merged 3 commits into
mainfrom
nocdx-publish-workflow
Oct 22, 2026
Merged

Mudaafi merged 3 commits into
mainfrom
nocdx-publish-workflow

Conversation

@Mudaafi

@Mudaafi Mudaafi commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

What

Replaces the manual versioning steps in How to version the .NET repo with a Publish workflow, run from the Actions tab after merging a PR to main.

Structured after the PLP UI repo: small composite actions, reusable workflows, one orchestrator.

File Purpose
workflows/publish.yml Orchestrator — manual dispatch
workflows/generate-docs.yml Regenerates docs/; reusable and independently dispatchable
workflows/publish-nuget.yml Builds, packs and pushes to NuGet
workflows/create-github-release.yml Creates the GitHub release
actions/next-version Resolves the next version from constructor.io.csproj
actions/set-version Writes the version to all 4 files, then verifies
actions/git-identity Attributes the release to whoever triggered it

Inputs: version-strategy (patch/minor/major/explicit), optional exact version, a release title, and a publish-to-nuget toggle. Each reusable workflow also keeps a manual trigger so a partially failed run can be resumed a step at a time.

Verified before opening this

  • Doxygen output reproduces exactly. Generated with 1.15.0 and INPUT = src/constructor.io src/Constructorio_NET.Tests README.md, HTML_OUTPUT = . — all 385 committed docs/*.html come back byte-identical. That's how the INPUT paths were derived rather than guessed.
  • Package shape matches what's live. Downloaded constructor.io 4.4.0 from NuGet and packed locally: same lib/netstandard2.0/{dll,xml}, same .NETStandard2.0 nuspec target, same Newtonsoft.Json 13.0.4 dependency. The library targets netstandard2.0; dotnet-version: 8.0.x is only the build SDK, needed because the test project targets net8.0.
  • Version bumping, across all 4 files / 5 locations, including the tab-indented .sln line.
  • The verify guard fires. set-version re-greps every file afterwards; reverting just the .sln makes it fail, so a silently non-matching sed can't ship a half-bumped release.
  • Attribution, end-to-end against a real remote with no global git identity: commits come out author=<you>, committer=github-actions[bot], and the annotated tag records you as tagger. Unresolvable actors (scheduled run, deleted account, API failure) fall back to the bot with a warning rather than failing the release.

Notes for review

  • publish.sh is kept as a manual fallback — it prompts for confirmation, so it can't run in CI. README now documents the workflow as the primary path and warns against bumping by hand, since doing both risks publishing twice.
  • An annotated tag takes its tagger from GIT_COMMITTER_*, not GIT_AUTHOR_* — tags have no author field. Hence the deliberate split: the tag uses the triggering user as committer, while commits keep the bot as committer, since the bot is what performed the push.
  • Doxygen is pinned to 1.15.0 because the version is baked into every page footer; bumping it reflows all of docs/.
  • The generated docs do not embed the SDK version (PROJECT_NUMBER is empty and ConstructorIO.Version is private with EXTRACT_PRIVATE = NO), so the docs step's position is about ordering only, not content.

Before the first real release

Two things I couldn't check without repo settings:

  1. NUGET_API_KEY must exist as a repo secret.
  2. Branch protection on main — if direct pushes are blocked, bump_version and generate_docs will both fail and the workflow needs a token with bypass.

Suggested first run: Publish: Generate documentation with commit unchecked. It touches nothing, and exercises the real Linux runner — including the GNU sed path, which could only be reasoned about locally, not executed.

🤖 Generated with Claude Code

Replaces the manual versioning steps with a Publish workflow, run from the
Actions tab after merging a PR to main. It bumps the version, regenerates the
documentation, tags the release, creates the GitHub release and pushes the
package to NuGet. Leaving publish-to-nuget unchecked stops it short of NuGet.

Documentation generation is a separate workflow so it can be run on its own,
and publishing and release creation are reusable so a partially failed run can
be resumed a step at a time.

Release commits are authored by whoever triggered the run, and the tag records
them as tagger; unresolvable actors fall back to the bot rather than failing.

publish.sh is kept as a manual fallback, since it prompts for confirmation and
cannot run in CI. README now documents the workflow as the primary path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Mudaafi
Mudaafi requested a review from a team as a code owner October 21, 2026 20:49
Copilot AI balanced review requested due to automatic review settings October 21, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Test failures do not block publication, release tagging follows a mutable branch, and manual version input permits shell injection.

3 open issues
What changed in this PR

Automates .NET SDK releases through GitHub Actions, retaining the manual publishing fallback.

Changes:

  • Adds release orchestration and independently runnable publishing workflows.
  • Adds version-management and git-attribution actions.
  • Documents the automated release process.
File Description
README.md Documents automated releases and manual fallback.
.github/​workflows/​publish.yml Orchestrates versioning, documentation, tagging, and publishing.
.github/​workflows/​publish-nuget.yml Builds and publishes NuGet packages.
.github/​workflows/​generate-docs.yml Regenerates, uploads, and optionally commits documentation.
.github/​workflows/​create-github-release.yml Creates releases with generated notes.
.github/​actions/​set-version/​action.yml Updates and verifies tracked versions.
.github/​actions/​next-version/​action.yml Resolves versions and checks existing tags.
.github/​actions/​git-identity/​action.yml Resolves release attribution with bot fallback.

Review effort: Balanced

Comment thread .github/workflows/publish-nuget.yml
Comment thread .github/workflows/publish.yml
Comment thread .github/workflows/publish.yml
Validate the version in publish-nuget before use. The workflow can be
dispatched directly, so the input has not been through the orchestrator's
checks; it is now passed as env and required to be semver, so shell
metacharacters cannot reach the script.

Pin the release to an immutable revision. Each job previously re-resolved the
branch, so a merge landing mid-release could enter the tag without having been
built or validated. The bump commit's SHA is now threaded through
documentation generation to the tag, and pushes use --force-with-lease so a
branch that moved underneath stops the release instead of absorbing it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation push relies on a missing remote-tracking reference after SHA checkout, blocking releases whenever documentation changes.

1 open issue
3 resolved since last review

Review effort: Balanced

Comment thread .github/workflows/generate-docs.yml Outdated
Alexey-Pavlov
Alexey-Pavlov previously approved these changes Oct 22, 2026
Restores publish.yml and generate-docs.yml to their state before 10a8ffc.
Checking out the bump commit by SHA left no origin/<branch> tracking ref,
so the bare --force-with-lease docs push failed with "stale info" whenever
the docs changed, blocking the tag and NuGet publish.

Rather than add an explicit lease on top, drop the SHA threading entirely
and follow constructorio-ui-plp: check out the branch by name, push plainly,
tag the branch tip. A merge landing mid-release can enter the tag; that is
accepted, as it is for the UI repos. The publish-nuget input validation
from 10a8ffc is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mudaafi
Mudaafi merged commit 5250d11 into main Oct 22, 2026
1 check failed
@Mudaafi
Mudaafi deleted the nocdx-publish-workflow branch October 22, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants