Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple unreleased version and BuildDate config #35

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

tboby
Copy link
Contributor

@tboby tboby commented Oct 26, 2024

WHAT

This partially implements the automatic pre-release version bumping from #5. It's currently a very simply increment patch + "-alpha".

It also

  • Updates the changelog
  • Partially updates the readme
  • Continues to improve edge-cases and testing, such as only unreleased, no release at all
  • Adds a configuration property to disable writing the BuildDate to assembly metadata

WHY

It makes sense to try to prevent accidental publishing under old version numbers.

WHAT NOT

This doesn't do the clever major/minor/patch derivation, nor height.

@tboby
Copy link
Contributor Author

tboby commented Oct 26, 2024

@baronfel I haven't added the configuration property for the AssemblyBuildDate because I'm not sure I understand why you would use it. Any chance you remember?

@baronfel
Copy link
Collaborator

The configuration would mostly come in because some people may not want dates of any kind 'stamped' into the assembly - Dates are a common source of non-determinism in builds and so it's common practice to either pin the date to UNIX epoch, omit the date entirely, or via some other means use a consistent date. I think it's safe-ish for this library because we would emit the date that's in the Changelog (and so would be stable), I'm just a bit cautious about dates in binaries in general.

@tboby
Copy link
Contributor Author

tboby commented Oct 27, 2024

@baronfel Could you check that I've set appropriate BeforeTargets? I had to add something to ensure it all happened before Assembly Attributes were written, but it was a bit of a guess!

To be honest, I'm not entirely sure why it wasn't necessary before, unless the assembly wasn't having the version written to it? Or unspecified ordering getting lucky?

@baronfel
Copy link
Collaborator

Good point on the timing. There are 4 scenarios we need to care about to make sure all the versions are set at the right times and places:

  • dotnet pack of single-TFM project
  • dotnet pack of multi-TFM project
  • dotnet build of project (single or multi-TFM, doesn't matter since the artifacts from build are inherently single-TFM)
  • dotnet build of a project that references a project using this library (to ensure that building the referenced project computes versions correctly before that referenced project is used by the main project)

@tboby tboby changed the title Simple unreleased version Simple unreleased version and BuildDate config Oct 29, 2024
@tboby
Copy link
Contributor Author

tboby commented Oct 29, 2024

@baronfel I've added testing for BuildDate + config, so I think this PR is ready. I'll look into the more sophisticated version bumping, and maybe creating a test solution with the different combinations. I'm going on holiday at the end of this week though, so that might not be imminent :)

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