Skip to content

Commit 4e70ab8

Browse files
committed
docs: rewrite README with product-oriented narrative
Reframe the repository as a product starter, highlight capabilities and advantages, and add screenshots from the live docs site to improve readability and adoption. Made-with: Cursor
1 parent dc6abd1 commit 4e70ab8

4 files changed

Lines changed: 72 additions & 136 deletions

File tree

225 KB
Loading
222 KB
Loading
148 KB
Loading

README.md

Lines changed: 72 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,172 +1,108 @@
1-
# dotnet.CI.template
1+
# Dotnet.CI.Template
22

33
[![CI and Release](https://github.com/AGIBuild/dotnet.CI.template/actions/workflows/ci.yml/badge.svg)](https://github.com/AGIBuild/dotnet.CI.template/actions/workflows/ci.yml)
44
[![CodeQL](https://github.com/AGIBuild/dotnet.CI.template/actions/workflows/codeql.yml/badge.svg)](https://github.com/AGIBuild/dotnet.CI.template/actions/workflows/codeql.yml)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
66

7-
**Stop wiring CI from scratch.** Start with a production-grade pipeline that builds, tests, packages, and releases your .NET projects across platforms -- with a single approval click.
7+
Build your .NET product on top of a complete engineering foundation, not from a blank folder.
88

9-
---
9+
This repository is a **productized starter** that gives you:
10+
- a real project structure (`src/`, `tests/`, `docs/`)
11+
- a typed build system (NUKE)
12+
- release-ready delivery (NuGet, GitHub Releases, SBOM, attestation)
13+
- multilingual documentation (English + Chinese)
1014

11-
## What You Get
15+
CI/CD is here, but it is not the protagonist; your product is.
1216

13-
Use this template and you instantly have:
17+
![Dotnet.CI.Template Home](.github/assets/readme/docs-home-hero.png)
1418

15-
```
16-
Push to main
17-
|
18-
v
19-
resolve-version ── Reads VersionPrefix, computes matrix, outputs version info
20-
|
21-
├──────────────────────────────┐
22-
v v
23-
build-and-test ─── Matrix build build-docs ── VitePress build (pre-check)
24-
| (3 platforms) |
25-
v |
26-
release ────────── [approval] |
27-
| NuGet + tag |
28-
├──────────────────────────────┘
29-
v
30-
deploy-docs ────── Deploy to GitHub Pages (optional, i18n)
31-
```
32-
33-
Both **pull requests** and **main pushes** run the full multi-platform matrix (linux / windows / macos) for Build + Test. On **releases** (version bumped), Publish + PackageApp are additionally enabled.
19+
## Why This Repo Exists
3420

35-
### Pipeline Highlights
21+
Most new projects lose momentum in the first week to repetitive setup:
22+
- wiring build scripts
23+
- writing CI pipelines
24+
- standardizing versioning
25+
- bolting on documentation later
3626

37-
| Feature | Details |
38-
|---------|---------|
39-
| **NUKE Build** | All build logic lives in C# targets -- no scattered shell scripts in YAML |
40-
| **Single Approval** | One `release` environment gate controls the entire release flow |
41-
| **Multi-Platform Matrix** | linux-x64, win-x64, osx-arm64 (+ optional Android/iOS) |
42-
| **NuGet Publishing** | Auto-push to NuGet.org with SHA256 manifest verification |
43-
| **Installer Packages** | Platform-specific zip archives attached to GitHub Releases |
44-
| **Version from Code** | `VersionPrefix` in `Directory.Build.props` is the single source of truth |
45-
| **SemVer Release Tags** | `v0.2.0` format — release triggers only when version is bumped |
46-
| **CodeQL Security** | Automated vulnerability scanning on every push and weekly |
47-
| **Graceful Degradation** | Missing NuGet key? Skipped. No docs config? Skipped. Nothing breaks. |
27+
`Dotnet.CI.Template` removes that tax. You start with a working product baseline and focus on business features from day one.
4828

49-
---
50-
51-
## Quick Start
29+
## Product Capabilities
5230

53-
### 1. Create your repo from this template
31+
| Capability | What You Get | Why It Matters |
32+
|---|---|---|
33+
| Product-ready structure | `src`, `tests`, `docs`, centralized build properties | Clear boundaries from the beginning |
34+
| Build system | NUKE targets in `build/BuildTask.*.cs` | Build logic in C#, not YAML sprawl |
35+
| Version model | `VersionPrefix` as single source of truth | Reproducible, auditable releases |
36+
| Delivery pipeline | Build, test, pack, publish, package, release | One flow from code to artifacts |
37+
| Supply-chain trust | SBOM + artifact attestation | Better compliance and traceability |
38+
| Documentation portal | VitePress with i18n and auto deployment | Docs evolve with code, not after it |
5439

55-
Click **[Use this template](https://github.com/AGIBuild/dotnet.CI.template/generate)** on GitHub.
40+
## Experience Snapshot
5641

57-
### 2. Configure environments
42+
### Product-first docs experience
5843

59-
Go to **Settings > Environments** and create a `release` environment with at least one required reviewer.
44+
![Guide Page](.github/assets/readme/docs-guide-page.png)
6045

61-
### 3. Set secrets (optional)
46+
### CI/CD as one module in Contributing
6247

63-
| Secret | Purpose |
64-
|--------|---------|
65-
| `NUGET_API_KEY` | Push packages to NuGet.org |
66-
67-
### 4. Push code and watch it go
68-
69-
```bash
70-
git push origin main
71-
```
48+
![CI/CD Page](.github/assets/readme/docs-cicd-page.png)
7249

73-
The pipeline runs automatically. When `build-and-test` completes, go to **Actions > Review deployments** to approve the release.
50+
## What Makes It Better Than Starting Empty
7451

75-
---
52+
| Comparison | Blank Repo | Dotnet.CI.Template |
53+
|---|---|---|
54+
| First successful release | days of setup | built-in path |
55+
| Build orchestration | mixed shell + YAML | NUKE targets |
56+
| Version governance | manual and error-prone | semantic, code-owned |
57+
| Documentation | added later (often stale) | integrated from day one |
58+
| Artifact provenance | optional / inconsistent | standardized |
7659

77-
## Project Structure
60+
## Architecture At A Glance
7861

62+
```text
63+
Product Code (src/) + Tests (tests/)
64+
|
65+
v
66+
NUKE Build Targets (build/)
67+
|
68+
v
69+
CI and Release Workflow (.github/workflows/ci.yml)
70+
|
71+
+--> Packages (.nupkg/.snupkg)
72+
+--> Installers (app-{runtime}.zip)
73+
+--> SBOM + Attestation
74+
+--> Docs Site (GitHub Pages)
7975
```
80-
.
81-
├── .github/workflows/
82-
│ ├── ci.yml # CI + Release pipeline
83-
│ └── codeql.yml # Security analysis
84-
├── build/
85-
│ ├── BuildTask.*.cs # NUKE targets (Build, Test, Pack, Publish, PackageApp, ...)
86-
│ └── _build.csproj
87-
├── src/ # Your application code
88-
├── tests/ # Your test projects
89-
├── docs/ # VitePress documentation (English + 中文)
90-
├── Directory.Build.props # Version + shared build properties
91-
└── global.json # SDK version pinning
92-
```
93-
94-
---
95-
96-
## Version Management
97-
98-
Versions follow SemVer (3-segment `Major.Minor.Patch`):
9976

100-
- **`VersionPrefix` in `Directory.Build.props`** is the single source of truth (e.g., `0.2.0`)
101-
- **Tags are created automatically**: `v0.2.0` — release triggers only when the tag doesn't exist yet
102-
- **`FileVersion`** includes the CI build number for traceability (e.g., `0.2.0.42`), visible in DLL properties
103-
- No manual tagging. No version input fields. Bump `VersionPrefix` via PR to trigger a release.
77+
## Quick Start
10478

105-
### Version commands
79+
1. Create your repository from this template:
80+
[Use this template](https://github.com/AGIBuild/dotnet.CI.template/generate)
81+
2. Configure `release` environment in GitHub (`Settings` -> `Environments`)
82+
3. Optional: add `NUGET_API_KEY`
83+
4. Push to `main` and approve release deployment in Actions
10684

10785
```bash
108-
./build.sh ShowVersion # show current version
109-
./build.sh UpdateVersion # patch increment: 0.2.0 -> 0.2.1
110-
./build.sh UpdateVersion --VersionPrefix 1.0.0 # set exact version
111-
```
112-
113-
Then commit and push -- CI takes care of the rest.
114-
115-
---
116-
117-
## Extending the Build
118-
119-
Build logic is in `build/BuildTask.*.cs` using [NUKE](https://nuke.build). Add new targets in C# and call them from workflows:
120-
121-
```csharp
122-
Target MyTarget => _ => _
123-
.DependsOn(Build)
124-
.Executes(() =>
125-
{
126-
// your build logic here
127-
});
128-
```
129-
130-
```yaml
131-
# in ci.yml
132-
- run: ./build.sh MyTarget
86+
git push origin main
13387
```
13488

135-
---
136-
137-
## Mobile Platform Support
89+
## Key Commands
13890

139-
Android and iOS builds are supported but disabled by default. Toggle them in `ci.yml`:
140-
141-
```yaml
142-
env:
143-
ENABLE_ANDROID: 'true'
144-
ENABLE_IOS: 'true'
91+
```bash
92+
./build.sh ShowVersion # show current version
93+
./build.sh UpdateVersion # patch increment
94+
./build.sh UpdateVersion --VersionPrefix 1.0.0 # set exact version
95+
./build.sh Test # build + test
96+
./build.sh Pack # build + test + pack
14597
```
14698

147-
---
148-
149-
## Concurrency
150-
151-
`CI and Release` runs are **serialized per branch** by default. The workflow uses a concurrency group (`ci-${{ github.ref }}`) with `cancel-in-progress: false`, meaning a new run on the same branch queues behind the running one instead of cancelling it.
152-
153-
---
154-
155-
## Documentation Deployment
156-
157-
Documentation is built with [VitePress](https://vitepress.dev/) and supports English (default) and Chinese.
158-
159-
To enable automatic documentation deployment to GitHub Pages:
160-
161-
1. `docs/package.json` is included by default in this template
162-
2. Enable GitHub Pages in **Settings > Pages > Source: GitHub Actions**
163-
3. The `build-docs` job builds VitePress on every push/PR (pre-check); `deploy-docs` deploys after each release
164-
4. Expected docs URL: `https://<owner>.github.io/<repo>/` (for this repo: `https://agibuild.github.io/dotnet.CI.template/`)
165-
166-
The `Resolve Version` job summary always shows this expected docs URL, even when docs deployment is skipped.
167-
If Pages is not enabled, `deploy-docs` is skipped with a notice instead of failing the whole workflow.
99+
## Documentation
168100

169-
---
101+
- Live docs: `https://agibuild.github.io/dotnet.CI.template/`
102+
- Product docs are organized as:
103+
- `guide/` (product understanding and onboarding)
104+
- `reference/` (API/reference content)
105+
- `contributing/` (development, CI/CD, releasing)
170106

171107
## License
172108

0 commit comments

Comments
 (0)