Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-version: 10.0.x

- name: Restore
run: dotnet restore .\CodeQuality.sln --verbosity minimal
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish NuGet

on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: read

jobs:
publish:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore
run: dotnet restore .\CodeQuality.sln --verbosity minimal

- name: Build
run: dotnet build .\CodeQuality.sln --configuration Release --no-restore --verbosity minimal

- name: Pack
run: dotnet pack .\src\CodeQuality\CodeQuality.csproj --configuration Release --no-build --output .\artifacts\packages --verbosity minimal

- name: Publish to nuget.org
run: >
dotnet nuget push ".\artifacts\packages\*.nupkg"
--api-key "${{ secrets.NUGET_API_KEY }}"
--source https://api.nuget.org/v3/index.json
--skip-duplicate
1 change: 1 addition & 0 deletions CodeQuality.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
LICENSE = LICENSE
LOCAL_NUGET.md = LOCAL_NUGET.md
Publish-LocalNuGet.ps1 = Publish-LocalNuGet.ps1
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ dotnet build .\CodeQuality.sln --configuration Release --no-restore --verbosity
dotnet pack .\src\CodeQuality\CodeQuality.csproj --configuration Release --no-build --verbosity minimal
```

## Publishing

Packages are published to nuget.org automatically when changes are merged into `master`.

Configure a GitHub Actions repository secret named `NUGET_API_KEY` with a nuget.org API key that has permission to push `Atya.Governance.CodeQuality`.

NuGet package versions are immutable. Update the package `<Version>` in `src/CodeQuality/CodeQuality.csproj` before merging a release change, otherwise nuget.org will reject the already-published version.

## Layout

- `src/CodeQuality` - NuGet package project and packaged analyzer configuration.
Expand Down
Loading