Skip to content

Enable deterministic builds and Source Link for produced NuGet packages - #461

Draft
GarrettBeatty wants to merge 1 commit into
masterfrom
gcbeatty/issue-460-fix
Draft

GarrettBeatty wants to merge 1 commit into
masterfrom
gcbeatty/issue-460-fix

Conversation

@GarrettBeatty

Copy link
Copy Markdown
Contributor

Fixes #460

Enables deterministic builds and Source Link for the produced NuGet packages (Amazon.ECS.Tools, Amazon.ElasticBeanstalk.Tools, Amazon.Lambda.Tools) so debuggers can step into shipped sources and package output is reproducible. Follows the canonical template aws/integrations-on-dotnet-aspire-for-aws#245.

Changes

  • buildtools/common.props (the shared props imported by the four packable src/ projects):
    • RepositoryUrl + RepositoryType=git, PublishRepositoryUrl=true, EmbedUntrackedSources=true, Deterministic=true
    • ContinuousIntegrationBuild gated on a portable multi-signal CI condition: '$(CI)' == 'true' or '$(TF_BUILD)' == 'true' or '$(CODEBUILD_BUILD_ID)' != ''
    • Microsoft.SourceLink.GitHub 8.0.0 PackageReference (PrivateAssets=all)
    • explicit SourceRoot ItemGroup guarded on '$(SourceRevisionId)' != '' — AWS release pipelines pack from a .git-less source archive, so Source Link emits nothing without it; the guard keeps local dev builds unaffected
  • .autover/changes/*.json — Patch entry for the three packable projects

Reviewer notes

  • Shared file choice: kept buildtools/common.props (this repo's established shared-props convention, imported only by the four packable src/ projects) rather than adding a root Directory.Build.props, which would wrongly scope the SourceLink reference onto the test//testapps/ projects.
  • CI detection: CI runs in CodeBuild, which sets CODEBUILD_BUILD_ID automatically, so the portable condition activates with no buildspec changes.
  • No central package management (no Directory.Packages.props) → single versioned PackageReference.
  • Verified: packed Amazon.Lambda.Tools with CODEBUILD_BUILD_ID set — ContinuousIntegrationBuild=true, Deterministic=true, and the nuspec carries <repository type="git" url="https://github.com/aws/aws-extensions-for-dotnet-cli" branch="refs/heads/gcbeatty/issue-460-fix" commit="885db76..." />. Without CI env vars, ContinuousIntegrationBuild stays unset (local dev unaffected).

Opened as a draft.

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.

Enable deterministic builds and Source Link for produced NuGet packages

1 participant