Skip to content

Commit b1be714

Browse files
committed
Fix publish.ps1 to handle NuGet version normalization correctly
1 parent 06a2925 commit b1be714

File tree

3 files changed

+56
-9
lines changed

3 files changed

+56
-9
lines changed

CONTRIBUTING.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to FFmpeg.AutoGen
1+
# Contributing to FFmpeg.AutoGen
22

33
Thank you for your interest in contributing to FFmpeg.AutoGen!
44

@@ -107,3 +107,40 @@ For general usage questions, please use:
107107
- [Questions Repository](https://github.com/Ruslan-B/FFmpeg.AutoGen.Questions/issues)
108108

109109
For project-specific questions about contributions, open an issue in this repository.
110+
111+
## Summary
112+
113+
This PR updates the project documentation and improves the publishing workflow in preparation for transitioning to a semi-managed model.
114+
115+
## Changes
116+
117+
### Documentation
118+
- ✅ Update README.md with MIT license and project transition announcement
119+
- ✅ Update LICENSE section to reflect MIT instead of LGPL
120+
- ✅ Add CONTRIBUTING.md with contributor guidelines
121+
- ✅ Add PUBLISHING.md with maintainer publishing instructions
122+
- ✅ Add PR template for better pull request process
123+
124+
### Build & Publish
125+
- ✅ Update Directory.Build.props with MIT license and 2025 copyright
126+
- ✅ Improve publish.ps1 with better error handling, validation checks, and user-friendly output
127+
- ✅ Add GitHub Actions workflow for automated NuGet publishing (`publish.yml`)
128+
- ✅ Update main.yml workflow to support .NET 9 and branch 8.0
129+
130+
### Infrastructure
131+
- ✅ Configure Git LFS for FFmpeg binary files
132+
- ✅ Migrate existing FFmpeg binaries to Git LFS
133+
134+
## Breaking Changes
135+
136+
None - all existing packages and functionality remain unchanged.
137+
138+
## Testing
139+
140+
- [x] Local build passes (`dotnet build -c Release`)
141+
- [x] Local tests pass (`dotnet test -c Release`)
142+
- [ ] Local NuGet package creation (will test before merge)
143+
144+
## Notes
145+
146+
This PR prepares the project for future changes while maintaining backward compatibility. All existing NuGet packages will continue to work as before.

Directory.Build.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<AssemblyVersion>$(Version)</AssemblyVersion>
1212
<FileVersion>$(Version)</FileVersion>
1313
<PackageTags>ffmpeg</PackageTags>
14-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1514
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
1615
<PackageReadmeFile>README.md</PackageReadmeFile>
1716
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
@@ -22,8 +21,8 @@
2221
</PropertyGroup>
2322

2423
<ItemGroup>
25-
<None Include="$(MSBuildThisFileDirectory)LICENSE.txt" Link="LICENSE.txt" Pack="true" PackagePath="LICENSE.txt" />
26-
<None Include="$(MSBuildThisFileDirectory)README.md" Link="README.md" Pack="true" PackagePath="README.md" />
24+
<None Include="$(MSBuildThisFileDirectory)LICENSE.txt" Link="LICENSE.txt" Pack="true" PackagePath="" />
25+
<None Include="$(MSBuildThisFileDirectory)README.md" Link="README.md" Pack="true" PackagePath="" />
2726
</ItemGroup>
2827

2928
</Project>

publish.ps1

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@ Write-Host "======================================" -ForegroundColor Cyan
99

1010
# Get version from Directory.Build.props
1111
$version = (Select-Xml -Path Directory.Build.props -XPath '/Project/PropertyGroup/Version').Node.'#text'
12+
13+
# NuGet normalizes version by removing trailing zero segments
14+
# For example: X.Y.Z.0 becomes X.Y.Z, but X.Y.Z.W (where W != 0) stays as is
15+
$versionParts = $version.Split('.')
16+
$packageVersion = $version
17+
if ($versionParts.Length -eq 4 -and $versionParts[3] -eq '0') {
18+
$packageVersion = "$($versionParts[0]).$($versionParts[1]).$($versionParts[2])"
19+
Write-Host "`nNote: Version $version will be normalized to $packageVersion in package names" -ForegroundColor Yellow
20+
}
21+
1222
Write-Host "`nVersion: $version" -ForegroundColor Yellow
23+
Write-Host "Package Version: $packageVersion" -ForegroundColor Yellow
1324

1425
# Check if we're on the correct branch
1526
$currentBranch = git rev-parse --abbrev-ref HEAD
@@ -69,11 +80,11 @@ if ($LASTEXITCODE -ne 0) {
6980

7081
Write-Host "`nPackages to be published:" -ForegroundColor Cyan
7182
$packages = @(
72-
".\FFmpeg.AutoGen\bin\Release\FFmpeg.AutoGen.$version.nupkg",
73-
".\FFmpeg.AutoGen.Abstractions\bin\Release\FFmpeg.AutoGen.Abstractions.$version.nupkg",
74-
".\FFmpeg.AutoGen.Bindings.DynamicallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLinked.$version.nupkg",
75-
".\FFmpeg.AutoGen.Bindings.DynamicallyLoaded\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLoaded.$version.nupkg",
76-
".\FFmpeg.AutoGen.Bindings.StaticallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.StaticallyLinked.$version.nupkg"
83+
".\FFmpeg.AutoGen\bin\Release\FFmpeg.AutoGen.$packageVersion.nupkg",
84+
".\FFmpeg.AutoGen.Abstractions\bin\Release\FFmpeg.AutoGen.Abstractions.$packageVersion.nupkg",
85+
".\FFmpeg.AutoGen.Bindings.DynamicallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLinked.$packageVersion.nupkg",
86+
".\FFmpeg.AutoGen.Bindings.DynamicallyLoaded\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLoaded.$packageVersion.nupkg",
87+
".\FFmpeg.AutoGen.Bindings.StaticallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.StaticallyLinked.$packageVersion.nupkg"
7788
)
7889

7990
foreach ($pkg in $packages) {

0 commit comments

Comments
 (0)