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
{{ message }}
Repository navigation
Commit 900dd18
Browse filesBrowse the repository at this point in the historyBrowse files
Move to monthly releases and expand the NuGet readme (#34)
## Summary
Moves the template from a release on every push to `main` to one release
a month, and gives the NuGet page real instructions.
- Pushes to `main` now build and test only. NuGet publishing and the
GitHub release happen on the 1st of each month at 9am America/Chicago.
- A new Release Check job compares `main` with the latest release tag
and skips the release when nothing outside `.github/` has changed.
- Running the Build Pipeline by hand still releases straight away. The
new **force** input releases even when only `.github/` has changed.
- Each release opens with a line saying it's the monthly release (or an
out-of-cycle one), followed by the generated notes for everything merged
since the previous release.
- Dependabot moves to a cron on the 15th, so dependency updates can be
merged before the next release. The scheduled build and Scorecard scan
move from weekly to the 15th at 9am America/Chicago, so all the
maintenance runs together and releases stay on the 1st.
- `NUGET.md` now covers install, creating a solution and its options,
running it, what's inside, updating and where to get help, with links
back to GitHub. The README gets a Releases section. The Docker docs are
unchanged.
- PR builds use `pr-<number>` as the prerelease suffix instead of the
branch names, which were long enough to trip NuGet's NU5123 path length
check.
- On pull requests the Code Coverage job now also requires 90% coverage
of the changed lines, on top of the 95% overall gate. README,
CONTRIBUTING and the PR template say so. Coverlet and `codecov.yml` now
leave out generated code (`obj/`, `[GeneratedCode]`, migrations), so the
Codecov report shows the same lines the gate checks. Codecov stays
informational.
## Related issues
None
## Type of change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change (the generated solution or template parameters
change in a way existing users will notice)
- [ ] Refactoring or clean-up
- [x] Documentation
- [x] Build, pipeline or dependency update
## Shared layers
- [ ] This only touches the Presentation layer of this template.
- [x] This touches the Application or Infrastructure layers, tests,
pipeline or repository setup, so it needs to be carried across all five
templates.
## Checklist
- [ ] `dotnet build` and `dotnet test` pass locally with no warnings.
- [ ] I added or updated tests, and coverage stays at or above 95%.
- [x] I updated the README or docs where behaviour changed.
- [ ] I checked the template still installs and creates a working
solution (see CONTRIBUTING.md).
Copy file name to clipboardExpand all lines: NUGET.md
+58-5Lines changed: 58 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,23 +2,76 @@
2
2
3
3
A `dotnet new` template for a GraphQL API built with a streamlined version of Clean Architecture and [Hot Chocolate](https://chillicream.com/docs/hotchocolate).
4
4
5
-
It shares its Application and Infrastructure layers with four sibling templates for Minimal APIs, Web API controllers, GraphQL, Model Context Protocol and AWS Lambda.
5
+
It's one of five templates, for Minimal APIs, Web API controllers, GraphQL, Model Context Protocol and AWS Lambda, that share the same Application and Infrastructure layers, tests and CI pipeline.
-[Docker](https://www.docker.com/products/docker-desktop) (optional, to build and run the container image)
11
+
12
+
## Install
8
13
9
14
```bash
10
15
dotnet new install CleanGraphQLApi.Template
11
16
```
12
17
13
-
## Usage
18
+
## Create a solution
14
19
15
20
```bash
16
21
dotnet new cleangraphqlapi --name {YOUR_SOLUTION_NAMESPACE} --authorName "{YOUR_NAME}"
17
22
```
18
23
19
-
## Documentation
24
+
| Option | Description |
25
+
| --- | --- |
26
+
|`--name`| The name of the solution, also used as the root namespace. |
27
+
|`--authorName`| The name of the author of the solution. |
28
+
|`--authority`| The OAuth authorization server that issues access tokens. Leave it empty to run the API without authentication. |
29
+
|`--audience`| The audience access tokens must be issued for, usually the API's own URL. |
30
+
31
+
With an authority set, the movie, author and review queries and the review mutations need a JWT bearer token, and the `version` query, the schema and Nitro stay open.
32
+
33
+
## Run it
34
+
35
+
From the new solution's folder, start the app and a Seq container for logs.
36
+
37
+
```bash
38
+
docker compose up -d
39
+
```
40
+
41
+
Then open Nitro, the GraphQL IDE, at <http://localhost:8080/graphql>. Seq shows the logs at <http://localhost:5341>.
42
+
43
+
Or run it without Docker.
44
+
45
+
```bash
46
+
dotnet run --project ./src/Presentation
47
+
```
48
+
49
+
Run the tests with `dotnet test`. Every way to run the solution is in `docs/RUN.md` inside it.
50
+
51
+
## What's inside
52
+
53
+
-**Presentation**: A [Hot Chocolate](https://chillicream.com/docs/hotchocolate) GraphQL schema with Relay paging, DataLoaders and the [Nitro](https://chillicream.com/docs/nitro) IDE
54
+
-**Application**: commands and queries through [Mediator](https://github.com/martinothamar/Mediator), validation with [FluentValidation](https://github.com/FluentValidation/FluentValidation) and mapping with [Mapperly](https://mapperly.riok.app)
55
+
-**Infrastructure**: [Entity Framework Core](https://learn.microsoft.com/ef/core) on SQLite with migrations and optional sample data
56
+
-**Tests**: [xUnit](https://xunit.net), [Shouldly](https://github.com/shouldly/shouldly) and [NSubstitute](https://github.com/nsubstitute/NSubstitute), each test on its own in-memory database
57
+
- A Dockerfile that runs as a non-root user, a `docker-compose.yml`, and a GitHub Actions pipeline with tests, a coverage gate, a container scan and CodeQL
58
+
59
+
## Updates
60
+
61
+
A new version is released on the 1st of each month with every change merged since the previous release, as long as something has changed. To update an installed template:
62
+
63
+
```bash
64
+
dotnet new update
65
+
```
66
+
67
+
What changed in each version is in the [release notes](https://github.com/stphnwlsh/CleanGraphQLApi/releases). To remove the template, run `dotnet new uninstall CleanGraphQLApi.Template`.
68
+
69
+
## More help
20
70
21
-
The [README on GitHub](https://github.com/stphnwlsh/CleanGraphQLApi#readme) covers the architecture, features and how to run the generated solution. Report bugs and ideas in [GitHub issues](https://github.com/stphnwlsh/CleanGraphQLApi/issues).
71
+
-[README on GitHub](https://github.com/stphnwlsh/CleanGraphQLApi#readme) for the architecture, every feature and the Docker build options
72
+
-[Running guide](https://github.com/stphnwlsh/CleanGraphQLApi/blob/main/docs/RUN.md) for every way to run, configure and test the solution
73
+
-[GitHub issues](https://github.com/stphnwlsh/CleanGraphQLApi/issues) for bugs and ideas
74
+
-[Security policy](https://github.com/stphnwlsh/CleanGraphQLApi/security/policy) to report a vulnerability privately
Copy file name to clipboardExpand all lines: README.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ It's one of five templates that share the same Application and Infrastructure la
18
18
-[Running the project](#running-the-project)
19
19
-[Architecture](#architecture)
20
20
-[Features](#features)
21
+
-[Releases](#releases)
21
22
-[Related templates](#related-templates)
22
23
-[Resources](#resources)
23
24
-[Contributing](#contributing)
@@ -96,11 +97,23 @@ The one deliberate break from Clean Architecture is that the Presentation projec
96
97
- Data stored in [SQLite](https://learn.microsoft.com/ef/core/providers/sqlite/) using [Entity Framework Core](https://learn.microsoft.com/ef/core) migrations, seeded with [Bogus](https://github.com/bchavez/Bogus) only when `Database:SeedSampleData` is on. Each test uses its own throwaway in-memory SQLite database, so tests never touch a real one or each other's data
97
98
- Testing using [xUnit](https://xunit.net), [Shouldly](https://github.com/shouldly/shouldly) and [NSubstitute](https://github.com/nsubstitute/NSubstitute), with coverage from [Coverlet](https://github.com/coverlet-coverage/coverlet)
98
99
- Build rules in `Directory.Build.props`: code style and the recommended analyzers are checked on every build, warnings fail it, and package versions live in one place with [Central Package Management](https://learn.microsoft.com/nuget/consume-packages/central-package-management)
99
-
- CI with GitHub Actions: build and test, a `dotnet format` check, 95% coverage gate, [Trivy](https://trivy.dev) container scan, [CodeQL](https://codeql.github.com) static analysis, then NuGet publishing and a GitHub release from `main` using [trusted publishing](https://learn.microsoft.com/nuget/nuget-org/trusted-publishing)
100
+
- CI with GitHub Actions: build and test, a `dotnet format` check, 95% coverage gate with at least 90% on the lines each pull request changes, [Trivy](https://trivy.dev) container scan, [CodeQL](https://codeql.github.com) static analysis, then a monthly NuGet release and GitHub release from `main` using [trusted publishing](https://learn.microsoft.com/nuget/nuget-org/trusted-publishing)
100
101
- Health checks at `/health/live` and `/health/ready`, using [ASP.NET Core health checks](https://learn.microsoft.com/aspnet/core/host-and-deploy/health-checks)
101
-
-Monthly grouped dependency updates using [Dependabot](https://docs.github.com/code-security/dependabot), including the pinned Seq image
102
+
-Grouped dependency updates on the 15th of each month using [Dependabot](https://docs.github.com/code-security/dependabot), including the pinned Seq image
102
103
- A Docker image that runs as a non-root user with a health check
103
104
105
+
## Releases
106
+
107
+
The template is released once a month. On the 1st, at 9am US Central time, the pipeline checks for changes since the last release. If anything outside `.github/` has changed, it builds and tests `main`, publishes the new version to [NuGet](https://www.nuget.org/packages/CleanGraphQLApi.Template) and creates a [GitHub release](https://github.com/stphnwlsh/CleanGraphQLApi/releases) with notes for every pull request merged since the previous one. If nothing has changed, there's no release that month. Dependency updates arrive on the 15th, so they're merged in time for the next release.
108
+
109
+
Versions keep the `YYYY.MM.DD.RUN` format. Up to the end of October 2026, every merge to `main` was released, so the older releases are much smaller. To release outside the monthly cycle, run the **Build Pipeline** workflow by hand. Tick **force** to release even when only `.github/` has changed.
110
+
111
+
To update an installed template to the latest release:
112
+
113
+
```bash
114
+
dotnet new update
115
+
```
116
+
104
117
## Related templates
105
118
106
119
All five templates share the same Application and Infrastructure layers, tests, CI pipeline and repository setup.
0 commit comments