Skip to content

Commit 20dfc97

Browse files
committed
Update project documentation and improve publish process
- Update README.md with MIT license and project transition announcement - Update Directory.Build.props with MIT license and 2025 copyright - Improve publish.ps1 with better error handling and validation - Add GitHub Actions workflow for automated NuGet publishing - Update main.yml workflow to support .NET 9 and branch 8.0 - Add CONTRIBUTING.md with contributor guidelines - Add PR template for better pull request process - Add PUBLISHING.md with maintainer publishing instructions
1 parent efc91e0 commit 20dfc97

File tree

14 files changed

+462
-40
lines changed

14 files changed

+462
-40
lines changed

.github/pull_request_template.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Description
2+
3+
<!-- Provide a brief description of your changes -->
4+
5+
## Type of Change
6+
7+
<!-- Mark the relevant option with an "x" -->
8+
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
13+
- [ ] Code generation update
14+
- [ ] Dependency update
15+
16+
## Related Issues
17+
18+
<!-- Link to related issues, e.g., "Fixes #123" or "Related to #456" -->
19+
20+
## Testing
21+
22+
<!-- Describe the tests you ran to verify your changes -->
23+
24+
- [ ] I have tested my changes locally
25+
- [ ] I have run `dotnet build -c Release` successfully
26+
- [ ] I have run `dotnet test -c Release` successfully
27+
- [ ] I have tested with the example project if applicable
28+
29+
## Checklist
30+
31+
- [ ] My code follows the project's code style
32+
- [ ] I have updated the documentation if needed
33+
- [ ] I have added tests for new functionality if applicable
34+
- [ ] All existing tests pass
35+
- [ ] I have checked that my changes don't introduce new warnings
36+
37+
## Additional Notes
38+
39+
<!-- Any additional information that reviewers should know -->

.github/workflows/main.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: main
22
on:
33
push:
4-
branches: [master]
4+
branches: [master, "8.0"]
55
pull_request:
6-
branches: [master]
6+
branches: [master, "8.0"]
77

88
jobs:
99
build:
@@ -12,10 +12,13 @@ jobs:
1212
matrix:
1313
os: [ubuntu-latest, windows-latest]
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- uses: actions/setup-dotnet@v4
1717
with:
18-
dotnet-version: '6.0.x'
18+
dotnet-version: |
19+
6.0.x
20+
8.0.x
21+
9.0.x
1922
- name: Install FFmpeg - linux
2023
if: matrix.os == 'ubuntu-latest'
2124
run: |
@@ -29,7 +32,9 @@ jobs:
2932
- uses: actions/upload-artifact@v4
3033
if: matrix.os == 'windows-latest'
3134
with:
32-
path: FFmpeg.AutoGen/bin/Release/*.nupkg
35+
name: nuget-packages
36+
path: |
37+
**/*.nupkg
3338
if-no-files-found: error
3439
- name: Codegen Build & Test
3540
if: matrix.os == 'windows-latest'

.github/workflows/publish.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to publish (leave empty to use Directory.Build.props)'
10+
required: false
11+
type: string
12+
13+
jobs:
14+
publish:
15+
runs-on: windows-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: |
25+
6.0.x
26+
8.0.x
27+
9.0.x
28+
29+
- name: Get version
30+
id: get_version
31+
shell: pwsh
32+
run: |
33+
if ("${{ github.event.inputs.version }}" -ne "") {
34+
$version = "${{ github.event.inputs.version }}"
35+
} else {
36+
$version = (Select-Xml -Path Directory.Build.props -XPath '/Project/PropertyGroup/Version').Node.'#text'
37+
}
38+
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
39+
Write-Host "Version: $version"
40+
41+
- name: Build
42+
run: dotnet build --configuration Release
43+
44+
- name: Test
45+
run: dotnet test --configuration Release --no-build
46+
47+
- name: Pack
48+
run: dotnet pack --configuration Release --no-build
49+
50+
- name: Publish to NuGet
51+
shell: pwsh
52+
env:
53+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
54+
run: |
55+
$version = "${{ steps.get_version.outputs.VERSION }}"
56+
$packages = @(
57+
"FFmpeg.AutoGen\bin\Release\FFmpeg.AutoGen.$version.nupkg",
58+
"FFmpeg.AutoGen.Abstractions\bin\Release\FFmpeg.AutoGen.Abstractions.$version.nupkg",
59+
"FFmpeg.AutoGen.Bindings.DynamicallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLinked.$version.nupkg",
60+
"FFmpeg.AutoGen.Bindings.DynamicallyLoaded\bin\Release\FFmpeg.AutoGen.Bindings.DynamicallyLoaded.$version.nupkg",
61+
"FFmpeg.AutoGen.Bindings.StaticallyLinked\bin\Release\FFmpeg.AutoGen.Bindings.StaticallyLinked.$version.nupkg"
62+
)
63+
64+
foreach ($pkg in $packages) {
65+
if (Test-Path $pkg) {
66+
Write-Host "Publishing $pkg..."
67+
dotnet nuget push $pkg --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY --skip-duplicate
68+
} else {
69+
Write-Host "Warning: $pkg not found"
70+
}
71+
}
72+
73+
- name: Create artifacts
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: nuget-packages
77+
path: |
78+
**/*.nupkg
79+
if-no-files-found: error

.vscode/launch.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": []
7+
}

CONTRIBUTING.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Contributing to FFmpeg.AutoGen
2+
3+
Thank you for your interest in contributing to FFmpeg.AutoGen!
4+
5+
## Project Status
6+
7+
This project is transitioning to a semi-managed model. The maintainer welcomes contributions from the community!
8+
9+
**Maintainer:** Ruslan Balanukhin ([@Ruslan-B](https://github.com/Ruslan-B))
10+
11+
## How to Contribute
12+
13+
### Reporting Issues
14+
15+
- Check if the issue already exists
16+
- Provide a clear description and steps to reproduce
17+
- Include relevant code samples and FFmpeg version information
18+
19+
### Submitting Pull Requests
20+
21+
1. **Fork the repository** and create your branch from `8.0` or `master`
22+
```bash
23+
git checkout -b feature/my-new-feature
24+
```
25+
26+
2. **Make your changes**
27+
- Follow existing code style
28+
- Add tests if applicable
29+
- Update documentation if needed
30+
31+
3. **Test your changes**
32+
```bash
33+
dotnet build -c Release
34+
dotnet test -c Release
35+
```
36+
37+
4. **Commit your changes**
38+
- Use clear commit messages
39+
- Reference related issues
40+
41+
5. **Push to your fork** and submit a pull request to the `8.0` branch
42+
43+
6. **Wait for review**
44+
- The maintainer will review your PR
45+
- Be ready to make changes if requested
46+
47+
## Development Setup
48+
49+
### Prerequisites
50+
51+
- Visual Studio 2022 with C# and C++ desktop development workloads
52+
- Windows SDK for desktop
53+
- .NET 6.0, 8.0, and 9.0 SDKs
54+
55+
### Building
56+
57+
```bash
58+
dotnet build -c Release
59+
```
60+
61+
### Running Tests
62+
63+
```bash
64+
dotnet test -c Release
65+
```
66+
67+
### Regenerating Bindings
68+
69+
Run the `FFmpeg.AutoGen.CppSharpUnsafeGenerator` project to regenerate all `*.g.cs` files.
70+
71+
## Code of Conduct
72+
73+
- Be respectful and inclusive
74+
- Focus on constructive feedback
75+
- Help create a welcoming environment for all contributors
76+
77+
## License
78+
79+
By contributing, you agree that your contributions will be licensed under the MIT License.
80+
81+
## Questions?
82+
83+
For general usage questions, please use:
84+
- [Stack Overflow](https://stackoverflow.com/search?tab=newest&q=ffmpeg%20autogen)
85+
- [Questions Repository](https://github.com/Ruslan-B/FFmpeg.AutoGen.Questions/issues)
86+
87+
For project-specific questions about contributions, open an issue in this repository.

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
<Authors>Ruslan Balanukhin</Authors>
66
<Company>Rationale One</Company>
77
<Product>FFmpeg.AutoGen</Product>
8-
<Copyright>Copyright © Ruslan Balanukhin 2023 All rights reserved.</Copyright>
8+
<Copyright>Copyright © Ruslan Balanukhin 2025 All rights reserved.</Copyright>
99
<PackageProjectUrl>https://github.com/Ruslan-B/FFmpeg.AutoGen</PackageProjectUrl>
1010
<RepositoryType>Git</RepositoryType>
1111
<AssemblyVersion>$(Version)</AssemblyVersion>
1212
<FileVersion>$(Version)</FileVersion>
1313
<PackageTags>ffmpeg</PackageTags>
14+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1415
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
1516
<PackageReadmeFile>README.md</PackageReadmeFile>
1617
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>

FFmpeg.AutoGen.CppSharpUnsafeGenerator/Generation/StructuresGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override IEnumerable<StructureDefinition> Query(IEnumerable<StructureD
2727

2828
protected override void GenerateDefinition(StructureDefinition structure)
2929
{
30-
this.WriteSummary(structure);
30+
this.WriteSummary(structure);
3131
if (!structure.IsComplete) WriteLine("/// <remarks>This struct is incomplete.</remarks>");
3232
this.WriteObsoletion(structure);
3333
if (structure.IsUnion) WriteLine("[StructLayout(LayoutKind.Explicit)]");

FFmpeg.AutoGen.Example/H264VideoStreamEncoder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public H264VideoStreamEncoder(Stream stream, int fps, Size frameSize)
4545

4646
public void Dispose()
4747
{
48-
ffmpeg.avcodec_close(_pCodecContext);
48+
//ffmpeg.avcodec_close(_pCodecContext);
4949
ffmpeg.av_free(_pCodecContext);
5050
}
5151

FFmpeg.AutoGen.Example/MediaDecoder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public VideoConverter(Size sourceSize, AVPixelFormat sourcePixelFormat,
1818
destinationSize.Width,
1919
destinationSize.Height,
2020
destinationPixelFormat,
21-
ffmpeg.SWS_FAST_BILINEAR,
21+
(int)SwsFlags.SWS_FAST_BILINEAR,
2222
null,
2323
null,
2424
null);

FFmpeg.AutoGen.Example/VideoFrameConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public VideoFrameConverter(Size sourceSize, AVPixelFormat sourcePixelFormat,
2424
destinationSize.Width,
2525
destinationSize.Height,
2626
destinationPixelFormat,
27-
ffmpeg.SWS_FAST_BILINEAR,
27+
(int)SwsFlags.SWS_FAST_BILINEAR,
2828
null,
2929
null,
3030
null);

0 commit comments

Comments
 (0)