Skip to content

Correct the release path before cutting 3.0.0 - #150

Merged
MichaelGHSeg merged 2 commits into
mainfrom
ci/release-path-correctness
Sep 30, 2026
Merged

MichaelGHSeg merged 2 commits into
mainfrom
ci/release-path-correctness

Conversation

@MichaelGHSeg

@MichaelGHSeg MichaelGHSeg commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #146. Release-machinery correctness only — no version bump here, deliberately, so the machinery can be verified before it carries a release.

The tag check missed the version that actually matters

deploy.yml compared the tag against <Version> in the csproj only. But SegmentVersion in Segment/Analytics/Version.cs is what the library reports at runtime:

public string Version => Segment.Analytics.Version.SegmentVersion;        // Analytics.cs
[LibraryVersionKey] = Version.SegmentVersion                              // ContextPlugin.cs

Leaving it stale publishes a correctly numbered package whose every event reports the previous version, with nothing failing. Both files are now checked, and the step names whichever disagrees.

Verified locally: passes when both match, fails on a tag mismatch, and fails when the csproj is right but Version.cs is stale.

Pack and push were solution-wide

dotnet pack ran across the whole solution and dotnet nuget push "**/*.nupkg" pushed whatever it found — so the sample projects could be packaged and published to NuGet. Pack is now limited to the library and pushes from a dedicated output folder. Confirmed locally to produce exactly one package, Segment.Analytics.CSharp.2.6.0.nupkg.

Restore, build and test also use the .slnf filter, matching ci.yml.

Removed the superseded release workflow

release.yml and deploy.yml both trigger on a bare semver tag, so a release fires two publishers. That is currently masked rather than handled: release.yml uses checkout@v3/setup-dotnet@v2/cache@v3 and fails at startup under sha_pinning_required, while deploy.yml runs. Anyone repinning it later would get two pushes on one tag.

It is not dead code — it published 2.6.0 on 2025-12-04 — but deploy.yml covers everything it did (same deployment environment and NUGET_API_KEY, same GitHub release) and adds Artifactory OIDC and the version checks.

RELEASING.md

Rewritten to match: both version files, tag after merging so the tag points at main rather than a branch commit, and the deployment environment approval step. The OpenUPM (unity/<version>) and pre-release sections are unchanged — both tag conventions are real and coexist, bare for NuGet and unity/ for OpenUPM.

deploy.yml checked the tag against the csproj only, but SegmentVersion in
Version.cs is what the library reports at runtime — Analytics.Version and the
library version on every event context. A stale value there would publish a
correctly numbered package that misreports itself, with nothing failing. Both
are checked now.

Restore, build and test use the solution filter, as CI does. Pack is limited to
the library project and pushes from a dedicated output folder: a solution-wide
pack would also package the sample projects, and the previous **/*.nupkg glob
would have pushed them to NuGet.

RELEASING.md described tagging before merging, which points the tag at a branch
commit, and mentioned only the csproj version in the numbered steps.
release.yml and deploy.yml both trigger on a bare semver tag, so a release
fires two publishers at once. Only the collision being masked keeps that from
double-pushing: release.yml uses unpinned actions and fails at startup under
the org's sha_pinning_required policy, while deploy.yml runs.

deploy.yml covers everything release.yml did — same deployment environment and
NUGET_API_KEY, same GitHub release — and adds Artifactory OIDC and the version
checks.
@MichaelGHSeg MichaelGHSeg mentioned this pull request Sep 30, 2026
@MichaelGHSeg
MichaelGHSeg merged commit a3ac404 into main Sep 30, 2026
10 of 11 checks passed
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.

2 participants