You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This workflow simplifies the process of publishing NuGet packages. Use this reusable workflow at `.github/workflows/publish-nuget-package-github.yml`. It is designed to be used for publishing packages in the package space of a GitHub organization.
27
+
28
+
### Calling the workflow <aname="nuget_calling"> <aid="nuget_calling"></a>
29
+
30
+
```yaml
31
+
# .github/workflows/publish-nuget-package-github.yml in a consumer repository
- `dotnet_version` _(string, default: empty)_ – Version of .NET SDK to use (e.g., '10.x').
55
+
- `project_path` _(string, default: empty)_ – Path to the .NET project file (e.g., 'project/project.csproj').
56
+
- `package_output` _(string, default: empty)_ – Output directory for the NuGet package (e.g., 'project/bin/Release').
57
+
- `package_version` _(string, default: empty)_ – Version of the NuGet package to publish (e.g., '1.0.0').
58
+
- `assembly_version` _(string, default: package version)_ – (Optional) Set specific assembly version (e.g., '1.0.0'). If not set, it will default to package version. This version usually has the same value as the package_version.
59
+
- `github_pat` _(string, default: empty)_ – GitHub Personal Access Token with 'write:packages' scope. Use it as secret variable -> `${{ secrets.GITHUB_TOKEN }}`.
Use the reusable workflow at `.github/workflows/semver-version.yml` to compute the next semantic version, expose it as an output, and tag the current commit.
8
64
9
-
### Calling the workflow
65
+
### Calling the workflow <a name="semantic_calling"> <a id="semantic_calling"></a>
10
66
11
67
```yaml
12
68
# .github/workflows/release.yml in a consumer repository
The workflow inspects the latest commit message and applies the following precedence:
64
120
@@ -70,25 +126,27 @@ If no existing tags matching `v*` are found, versioning starts from `0.0.0`.
70
126
71
127
Each run also publishes (or updates) a Git tag matching the new version. By default tags look like `vX.Y.Z`, but you can provide a `prefix` input (for example `license-module`) to emit tags such as `license-module-vX.Y.Z`. The workflow creates a GitHub release with auto-generated release notes for the generated tag. Existing tags or releases are detected and left untouched.
A PowerShell-based Git commit-msg hook is available at `git/hooks/enforceConventionalCommits/commit-msg.ps1` to enforce the [Conventional Commits](https://www.conventionalcommits.org/) standard locally before commits are created.
0 commit comments