Skip to content

build: Directory.Build.props for centralised SAMVersion stamping#4

Merged
michaldengusiak merged 4 commits into
sow/2026-Q2from
fix/directory-build-props
May 20, 2026
Merged

build: Directory.Build.props for centralised SAMVersion stamping#4
michaldengusiak merged 4 commits into
sow/2026-Q2from
fix/directory-build-props

Conversation

@michaldengusiak

Copy link
Copy Markdown

Mirrors SAM-BIM/SAM#7. Stage 2.

  • Directory.Build.props at repo root.
  • csproj/AssemblyInfo: strip duplicated AssemblyVersion/FileVersion/Deterministic; add SPDX where missing.
  • build.yml: sow/** triggers, hybrid branch/date Compute SAMVersion (UInt16-safe), /p:SAMVersion injected, dep-clone candidate derives current sow branch (Codex P1 fix from SAM_SolarCalculator#5).

Mirrors SAM-BIM/SAM#7. Stage 2 of the AssemblyVersion versioning migration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: acf2a39986

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/build.yml Outdated
# .NET AssemblyVersion components are UInt16 (max 65535). Cap to 60000 for headroom.
$run = ${{ github.run_number }} % 60000
if ($ref -match 'sow/(\d{4})-Q(\d)') {
$v = "$($Matches[1]).$($Matches[2]).$run"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Emit four-part SAMVersion for file version stamping

SAMVersion is later written into AssemblyFileVersionAttribute by Directory.Build.props (_GenerateSAMVersionFile), but both assignments here produce a 3-part value (YYYY.Q.run). AssemblyFileVersion expects a 4-part dotted version; with 3 parts the compiler emits a warning and Windows file properties can show unpredictable results, and this can become a hard CI failure in builds that treat warnings as errors. Please append a revision component (for example .0) in both code paths.

Useful? React with 👍 / 👎.

PowerShell 5.1 doesn't support backtick-u escape sequences; the
apply-stage2.ps1 script leaked them as literal text in 'Copyright (c) 2020u{2013}2026'.
Codex P1 on SAM_LadybugTools#4: classic (non-SDK) csprojs don't set
GenerateAssemblyInfo at all, so the previous '== false' condition skipped
them. Switching to '!= true' catches both GenerateAssemblyInfo=false
(SDK projects with legacy AssemblyInfo.cs) AND empty (classic projects).
- Append .0 so SAMVersion is 4-part (AssemblyFileVersion expects 4 parts).
- Prefer github.head_ref when it matches sow/yyyy-Qx (release-promotion PRs).
- Mirrors SAM sow/2026-Q2 6d87d98e.
@michaldengusiak

Copy link
Copy Markdown
Author

Thanks @codex — fixed in the P2 sweep. SAMVersion is now YYYY.Q.<run>.0 (4-part). Applied to all 30 cascade PRs and to SAM sow/2026-Q2 directly.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@michaldengusiak
michaldengusiak merged commit f896c87 into sow/2026-Q2 May 20, 2026
2 checks passed
@michaldengusiak
michaldengusiak deleted the fix/directory-build-props branch May 20, 2026 19:15
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.

1 participant