Skip to content

Commit 448933b

Browse files
committed
docs: restructure site from CI-centric to product-centric layout
Move CI/CD and release guides into contributing/ section, add product-oriented guide/, reference/ sections with i18n support. Made-with: Cursor
1 parent ad586fd commit 448933b

15 files changed

Lines changed: 506 additions & 116 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 70 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,89 @@
11
import { defineConfig } from 'vitepress'
22

33
export default defineConfig({
4-
title: 'dotnet.CI.template',
5-
description: 'Production-ready .NET CI/CD template',
4+
title: 'Dotnet.CI.Template',
5+
description: 'A production-ready .NET project template with built-in CI/CD',
66
base: '/dotnet.CI.template/',
77

88
locales: {
99
root: {
1010
label: 'English',
1111
lang: 'en',
1212
themeConfig: {
13-
nav: [{ text: 'Guide', link: '/quick-start-release' }],
14-
sidebar: [
15-
{
16-
text: 'Guide',
17-
items: [
18-
{ text: 'Quick Start Release', link: '/quick-start-release' },
19-
{ text: 'GitHub Workflows Guide', link: '/github-workflows-guide' }
20-
]
21-
}
22-
]
13+
nav: [
14+
{ text: 'Guide', link: '/guide/introduction' },
15+
{ text: 'Reference', link: '/reference/api' },
16+
{ text: 'Contributing', link: '/contributing/development' }
17+
],
18+
sidebar: {
19+
'/guide/': [
20+
{
21+
text: 'Guide',
22+
items: [
23+
{ text: 'Introduction', link: '/guide/introduction' },
24+
{ text: 'Getting Started', link: '/guide/getting-started' }
25+
]
26+
}
27+
],
28+
'/reference/': [
29+
{
30+
text: 'Reference',
31+
items: [
32+
{ text: 'API', link: '/reference/api' }
33+
]
34+
}
35+
],
36+
'/contributing/': [
37+
{
38+
text: 'Contributing',
39+
items: [
40+
{ text: 'Development', link: '/contributing/development' },
41+
{ text: 'CI/CD', link: '/contributing/ci-cd' },
42+
{ text: 'Releasing', link: '/contributing/releasing' }
43+
]
44+
}
45+
]
46+
}
2347
}
2448
},
2549
'zh-cn': {
2650
label: '简体中文',
2751
lang: 'zh-CN',
2852
themeConfig: {
29-
nav: [{ text: '指南', link: '/zh-cn/quick-start-release' }],
30-
sidebar: [
31-
{
32-
text: '指南',
33-
items: [
34-
{ text: '快速发版', link: '/zh-cn/quick-start-release' },
35-
{ text: 'Workflows 指南', link: '/zh-cn/github-workflows-guide' }
36-
]
37-
}
38-
]
53+
nav: [
54+
{ text: '指南', link: '/zh-cn/guide/introduction' },
55+
{ text: '参考', link: '/zh-cn/reference/api' },
56+
{ text: '开发贡献', link: '/zh-cn/contributing/development' }
57+
],
58+
sidebar: {
59+
'/zh-cn/guide/': [
60+
{
61+
text: '指南',
62+
items: [
63+
{ text: '产品介绍', link: '/zh-cn/guide/introduction' },
64+
{ text: '快速开始', link: '/zh-cn/guide/getting-started' }
65+
]
66+
}
67+
],
68+
'/zh-cn/reference/': [
69+
{
70+
text: '参考',
71+
items: [
72+
{ text: 'API', link: '/zh-cn/reference/api' }
73+
]
74+
}
75+
],
76+
'/zh-cn/contributing/': [
77+
{
78+
text: '开发贡献',
79+
items: [
80+
{ text: '开发环境', link: '/zh-cn/contributing/development' },
81+
{ text: 'CI/CD 流程', link: '/zh-cn/contributing/ci-cd' },
82+
{ text: '发版指南', link: '/zh-cn/contributing/releasing' }
83+
]
84+
}
85+
]
86+
}
3987
}
4088
}
4189
},
Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# GitHub Workflows Guide
1+
# CI/CD Pipeline
22

3-
The goal of these workflows is straightforward:
3+
The goal of this pipeline is straightforward:
44
**Every commit gets quality feedback, releases are automated, artifacts are traceable and reproducible.**
55

6-
If you just created a repository from this template, think of it as a standard pipeline:
7-
86
```text
97
push / PR to main
108
└─ CI and Release
@@ -18,7 +16,7 @@ push / PR to main + weekly
1816
└─ CodeQL (security scan)
1917
```
2018

21-
For a quick release walkthrough, see: [Quick Start Release](quick-start-release.md).
19+
For a quick release walkthrough, see: [Releasing](releasing.md).
2220

2321
---
2422

@@ -75,22 +73,7 @@ For a quick release walkthrough, see: [Quick Start Release](quick-start-release.
7573

7674
---
7775

78-
## 3) Quickest Path to Get Started (Recommended)
79-
80-
1. Push a commit to `main`
81-
Verify that both `CI and Release` and `CodeQL` are green.
82-
83-
2. Go to Actions → find the workflow run → click **Review deployments**
84-
Approve the `release` environment.
85-
86-
3. Check the Releases page:
87-
- A tag was created (e.g., `v0.2.0`)
88-
- The GitHub Release contains platform installer zips
89-
- A corresponding package version exists on NuGet.org (if `NUGET_API_KEY` is configured)
90-
91-
---
92-
93-
## 4) Environment Configuration (Required)
76+
## 3) Environment Configuration
9477

9578
### `release` environment
9679
In GitHub repository Settings → Environments → create `release`:
@@ -101,15 +84,15 @@ In GitHub repository Settings → Environments → create `release`:
10184
The repository includes built-in VitePress documentation support. To enable documentation publishing:
10285
- Settings → Pages → Source: select GitHub Actions
10386
- The `github-pages` environment is created automatically
104-
- Expected documentation URL: `https://<owner>.github.io/<repo>/` (for this repo: `https://agibuild.github.io/dotnet.CI.template/`)
87+
- Expected documentation URL: `https://<owner>.github.io/<repo>/`
10588
- The `Resolve Version` summary displays this URL for quick access
10689

10790
### Secrets
10891
- `NUGET_API_KEY`: NuGet.org API key (configure at the repo or `release` environment level)
10992

11093
---
11194

112-
## 5) Version Mechanism FAQ (Important)
95+
## 4) Version Mechanism FAQ
11396

11497
### Q1: Where does the version come from?
11598
The version comes from `VersionPrefix` in `Directory.Build.props`. CI does not accept manually input version parameters.
@@ -132,7 +115,7 @@ No. Each version can only be released once. If the tag `v{version}` already exis
132115

133116
---
134117

135-
## 6) CLI Trigger (Optional)
118+
## 5) CLI Trigger (Optional)
136119

137120
```bash
138121
# Manually trigger CI and Release
@@ -141,7 +124,7 @@ gh workflow run ci.yml --ref main
141124

142125
---
143126

144-
## 7) Common Troubleshooting (Check Here First)
127+
## 6) Troubleshooting
145128

146129
- Tag already exists: This version was already published; bump `VersionPrefix` via PR
147130
- NuGet push failed: Verify that `NUGET_API_KEY` is configured
@@ -152,7 +135,7 @@ gh workflow run ci.yml --ref main
152135

153136
---
154137

155-
## 8) Team Collaboration Tips
138+
## 7) Team Collaboration Tips
156139

157140
- During daily development, just watch for green CI (Build + Test + CodeQL)
158141
- Release management is controlled through environment approval — no manual packaging or artifact transfer

docs/contributing/development.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Development
2+
3+
## Prerequisites
4+
5+
| Tool | Version | Notes |
6+
|---|---|---|
7+
| .NET SDK | 10.0+ | Pinned in `global.json` (`rollForward: latestFeature`) |
8+
| Git | 2.x | |
9+
| Node.js | 18+ | Only needed for docs (`docs/package.json`) |
10+
11+
## Clone & Build
12+
13+
```bash
14+
git clone https://github.com/AGIBuild/dotnet.CI.template.git
15+
cd dotnet.CI.template
16+
17+
./build.sh # Linux / macOS
18+
build.ps1 # Windows
19+
```
20+
21+
The default target is **Build** (Restore → Build).
22+
23+
## NUKE Build Targets
24+
25+
All build logic lives in `build/`. Workflows call these targets instead of raw `dotnet` commands.
26+
27+
| Target | Depends On | Description |
28+
|---|---|---|
29+
| **Restore** || `dotnet restore` + tool restore |
30+
| **Build** | Restore | Build the solution |
31+
| **Test** | Build | Run tests with coverage (trx + Coverlet) |
32+
| **Pack** | Test | Pack NuGet packages (.nupkg + .snupkg) |
33+
| **Publish** | Restore | Publish the app for a given `--Runtime` |
34+
| **PackageApp** | Publish | Zip published output to `app-{runtime}.zip` |
35+
| **Format** | Restore | `dotnet format --verify-no-changes` |
36+
| **CoverageReport** | Test | Generate HTML + Cobertura coverage report |
37+
| **ShowVersion** || Print current `VersionPrefix` |
38+
| **UpdateVersion** || Bump patch or set `--VersionPrefix` explicitly |
39+
| **GenerateReleaseManifest** | Pack | Create `release-manifest.json` with SHA256 hashes |
40+
41+
### Common Commands
42+
43+
```bash
44+
./build.sh Test # Build + Test
45+
./build.sh Pack # Build + Test + Pack
46+
./build.sh Publish --Runtime linux-x64 --SelfContained # Publish self-contained
47+
./build.sh CoverageReport # Generate coverage HTML
48+
./build.sh ShowVersion # Print version
49+
./build.sh UpdateVersion # Patch bump (e.g. 0.2.0 → 0.2.1)
50+
./build.sh UpdateVersion --VersionPrefix 1.0.0 # Set version explicitly
51+
```
52+
53+
### Parameters
54+
55+
| Parameter | Default | Description |
56+
|---|---|---|
57+
| `--Configuration` | `Debug` (local) / `Release` (CI) | Build configuration |
58+
| `--VersionPrefix` || Version to set (used by `UpdateVersion`) |
59+
| `--VersionSuffix` || Prerelease suffix (e.g. `ci.42`) |
60+
| `--Runtime` || Target RID for `Publish` (e.g. `linux-x64`) |
61+
| `--SelfContained` | `false` | Produce self-contained output |
62+
63+
### Artifacts
64+
65+
All outputs go to `artifacts/`:
66+
67+
```text
68+
artifacts/
69+
├── test-results/ # .trx files + coverage
70+
├── packages/ # .nupkg + .snupkg + release-manifest.json
71+
├── publish/ # dotnet publish output
72+
└── installers/ # app-{runtime}.zip
73+
```
74+
75+
## Docs Development
76+
77+
```bash
78+
cd docs
79+
npm install
80+
npm run docs:dev # Local dev server at http://localhost:5173
81+
npm run docs:build # Production build
82+
npm run docs:preview # Preview production build
83+
```
84+
85+
## Next Steps
86+
87+
- [CI/CD Pipeline](ci-cd.md) — how the GitHub Actions workflow operates.
88+
- [Releasing](releasing.md) — how to ship a new version.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Quick Start: Release in 2 Minutes
1+
# Releasing
22

3-
Audience: New team members working with this repository for the first time.
3+
Audience: Team members shipping a new version.
44
Goal: **Complete a standard Release quickly**.
55

66
---
77

8-
## 0) Prerequisites (30 seconds)
8+
## 0) Prerequisites
99

1010
- You have write access to the repository
1111
- `main` branch is up to date and CI is passing
@@ -39,19 +39,19 @@ After pushing to `main`:
3939

4040
---
4141

42-
## 3) Success Criteria (30-second check)
42+
## 3) Success Criteria
4343

4444
After a successful run, you should see:
4545

4646
- A new tag (e.g., `v0.2.0`)
4747
- A new GitHub Release
4848
- Release assets including platform installer zips (`app-linux-x64.zip`, `app-win-x64.zip`, etc.) and the SBOM file
4949
- A corresponding package version on NuGet.org (if `NUGET_API_KEY` is configured)
50-
- If Pages is enabled: documentation at `https://agibuild.github.io/dotnet.CI.template/`
50+
- If Pages is enabled: documentation deployed automatically
5151

5252
---
5353

54-
## 4) Version Management (Must Read)
54+
## 4) Version Management
5555

5656
The version comes from `VersionPrefix` in `Directory.Build.props` — a pure 3-segment SemVer (e.g., `0.2.0`). A release is triggered only when this version differs from the latest git tag.
5757

@@ -65,7 +65,7 @@ After committing the change to `main`, CI automatically builds and publishes wit
6565

6666
---
6767

68-
## 5) Common Failure Troubleshooting
68+
## 5) Troubleshooting
6969

7070
- `Tag already exists`: This version was already released; bump `VersionPrefix` and retry
7171
- `No .nupkg files found`: No artifacts from the packaging stage; check Build/Test/Pack logs
@@ -83,4 +83,4 @@ gh workflow run ci.yml --ref main
8383

8484
---
8585

86-
For detailed information, see: [GitHub Workflows Guide](github-workflows-guide.md).
86+
For detailed pipeline information, see: [CI/CD Pipeline](ci-cd.md).

docs/guide/getting-started.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Getting Started
2+
3+
## Installation
4+
5+
Add the NuGet package to your project:
6+
7+
```bash
8+
dotnet add package Dotnet.CI.Template.Sample
9+
```
10+
11+
## Usage
12+
13+
```csharp
14+
using Dotnet.CI.Template.Sample;
15+
16+
var calculator = new Calculator();
17+
18+
var sum = calculator.Add(2, 3); // 5
19+
var quotient = calculator.Divide(10, 2); // 5
20+
```
21+
22+
## Using as a Template
23+
24+
1. Click **Use this template** on the [GitHub repository](https://github.com/AGIBuild/dotnet.CI.template).
25+
2. Rename solution, projects, and namespaces to match your product.
26+
3. Replace the sample `Calculator` class with your own code.
27+
4. Update `Directory.Build.props` with your package metadata.
28+
5. Configure the `release` environment in GitHub Settings (see [Releasing](../contributing/releasing.md)).
29+
30+
## Next Steps
31+
32+
- [API Reference](../reference/api.md)
33+
- [Development Setup](../contributing/development.md)

0 commit comments

Comments
 (0)