Dynamic version extraction from Directory.Packages.props for GitHub workflows #257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces hardcoded version numbers in GitHub Actions workflows with dynamic version extraction from
Directory.Packages.props, ensuring a single source of truth for version management.Problem
The GitHub workflows were using hardcoded version
0.9.0in Docker image tagging, which required manual updates whenever the project version changed. This created a maintenance burden and potential for version inconsistencies.Solution
Implemented dynamic version extraction that:
Extracts version components from
Directory.Packages.props:<Version>0.9.$(VersionSuffix)</Version><VersionSuffix>0</VersionSuffix>Resolves MSBuild variables to produce the final version (
0.9.0)Handles edge cases gracefully by defaulting missing
VersionSuffixto0Changes Made
.github/workflows/docker-image.ymlDirectory.Packages.props0.9.0with dynamic${{ steps.get_version.outputs.version }}latestand the current version.github/workflows/release.ymlVersionSuffixvaluesvprefix for release tags (e.g.,v0.9.0)Technical Implementation
Benefits
Directory.Packages.props0.9.0version unchangedValidation
0.9.0koala-wiki:0.9.0v0.9.0Future version updates now only require modifying
Directory.Packages.props- the workflows will automatically adapt.Fixes #256.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
nuget.cdn.azure.cndotnet restore KoalaWiki.sln(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.