Skip to content

Commit 0d2d67c

Browse files
authored
Merge pull request #4104 from arturcic/feature/4017
Keep `configuration.md` file in sync with the changes in code
2 parents cd89b91 + 083204b commit 0d2d67c

File tree

19 files changed

+1137
-44
lines changed

19 files changed

+1137
-44
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
uses: chabad360/htmlproofer@master
111111
with:
112112
directory: ./artifacts/docs/preview
113-
arguments: --ignore-urls /api/,/docs/ --allow-hash-href --assume-extension --disable-external --no-check_external_hash
113+
arguments: --ignore-urls /api/,/docs/ --allow-hash-href --allow-missing-href --assume-extension --disable-external --no-check_external_hash
114114
-
115115
name: '[Reviewdog Reporter]'
116116
id: reporter

.github/workflows/mkdocs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Markdown Update
2+
on:
3+
push:
4+
5+
env:
6+
DOTNET_ROLL_FORWARD: "Major"
7+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
8+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
9+
DOTNET_NOLOGO: 1
10+
11+
defaults:
12+
run:
13+
shell: pwsh
14+
15+
jobs:
16+
docs:
17+
name: Update Markdown (embedded snippets)
18+
runs-on: ubuntu-latest
19+
steps:
20+
-
21+
name: Checkout
22+
uses: actions/checkout@v4
23+
-
24+
name: Run MarkdownSnippets
25+
run: |
26+
dotnet tool install --global MarkdownSnippets.Tool
27+
mdsnippets --write-header false
28+
working-directory: ${{ github.workspace }}/docs/input
29+
-
30+
name: Check for changes
31+
id: status
32+
run: |
33+
if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT }
34+
-
35+
name: Push changes
36+
run: |
37+
git add --verbose .
38+
git config user.name 'Artur Stolear'
39+
git config user.email '[email protected]'
40+
git commit -m 'Docs changes' --allow-empty
41+
git push --force
42+
if: steps.status.outputs.has_changes == '1'

build/CI.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
4242
..\.github\workflows\_unit_tests.yml = ..\.github\workflows\_unit_tests.yml
4343
..\.github\workflows\stale.yml = ..\.github\workflows\stale.yml
4444
..\.github\workflows\winget.yml = ..\.github\workflows\winget.yml
45+
..\.github\workflows\mkdocs.yml = ..\.github\workflows\mkdocs.yml
4546
..\.github\dependabot.yml = ..\.github\dependabot.yml
4647
EndProjectSection
4748
EndProject

build/docs/BuildLifetime.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ public override void Setup(BuildContext context, ISetupContext info)
2020
Theme = "Samson",
2121
OutputPath = context.MakeAbsolute(Paths.ArtifactsDocs.Combine("preview")),
2222
RootPath = context.MakeAbsolute(Paths.Docs),
23-
ConfigurationFile = context.MakeAbsolute(Paths.Docs.CombineWithFilePath("config.wyam")),
2423
Settings = new Dictionary<string, object>
2524
{
2625
{ "BaseEditUrl", "https://github.com/gittools/GitVersion/tree/main/docs/input/" },
2726
{ "SourceFiles", context.MakeAbsolute(Paths.Src) + "/**/{!bin,!obj,!packages,!*.Tests,!GitTools.*,}/**/*.cs" },
2827
{ "Title", "GitVersion" },
29-
{ "IncludeGlobalNamespace", false }
30-
}
28+
{ "IncludeGlobalNamespace", false },
29+
{ "IgnoreFolders", "**/mdsource" }
30+
},
31+
EnvironmentVariables = new Dictionary<string, string>
32+
{
33+
{ "DOTNET_ROLL_FORWARD", "Major" },
34+
},
3135
};
3236

3337
context.StartGroup("Build Setup");

build/docs/Tasks/PublishDocs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static bool AnyDocsChanged(ICakeContext context)
5858
var filesChanged = context.GitDiff(Paths.Root, sourceCommit.Sha);
5959

6060
const string path = "docs/";
61-
var docFileChanged = filesChanged.Any(file => file.OldPath.StartsWith(path) || file.Path.StartsWith(path) || file.Path.Contains("config.wyam"));
61+
var docFileChanged = filesChanged.Any(file => file.OldPath.StartsWith(path) || file.Path.StartsWith(path));
6262
return docFileChanged;
6363
}
6464

docs/config.wyam

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/input/docs/reference/configuration.md

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ tag-prefix: '[abc]'
3838
3939
The built-in configuration for the `GitFlow` workflow (`workflow: GitFlow/v1`) looks like:
4040

41-
```yaml
41+
<!-- snippet: /docs/workflows/GitFlow/v1.yml -->
42+
<a id='snippet-/docs/workflows/GitFlow/v1.yml'></a>
43+
```yml
4244
assembly-versioning-scheme: MajorMinorPatch
4345
assembly-file-versioning-scheme: MajorMinorPatch
4446
tag-prefix: '[vV]?'
@@ -207,10 +209,14 @@ tracks-release-branches: false
207209
is-release-branch: false
208210
is-main-branch: false
209211
```
212+
<sup><a href='/docs/workflows/GitFlow/v1.yml#L1-L167' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/GitFlow/v1.yml' title='Start of snippet'>anchor</a></sup>
213+
<!-- endSnippet -->
210214

211215
The supported built-in configuration for the `GitHubFlow` workflow (`workflow: GitHubFlow/v1`) looks like:
212216

213-
```yaml
217+
<!-- snippet: /docs/workflows/GitHubFlow/v1.yml -->
218+
<a id='snippet-/docs/workflows/GitHubFlow/v1.yml'></a>
219+
```yml
214220
assembly-versioning-scheme: MajorMinorPatch
215221
assembly-file-versioning-scheme: MajorMinorPatch
216222
tag-prefix: '[vV]?'
@@ -270,12 +276,12 @@ branches:
270276
increment: Inherit
271277
prevent-increment:
272278
when-current-commit-tagged: false
279+
track-merge-message: true
273280
regex: ^features?[/-](?<BranchName>.+)
274281
source-branches:
275282
- main
276283
- release
277284
is-source-branch-for: []
278-
track-merge-message: true
279285
is-main-branch: false
280286
pre-release-weight: 30000
281287
pull-request:
@@ -286,28 +292,28 @@ branches:
286292
of-merged-branch: true
287293
when-current-commit-tagged: false
288294
label-number-pattern: '[/-](?<number>\d+)'
295+
track-merge-message: true
289296
regex: ^(pull|pull\-requests|pr)[/-]
290297
source-branches:
291298
- main
292299
- release
293300
- feature
294301
is-source-branch-for: []
295-
track-merge-message: true
296302
pre-release-weight: 30000
297303
unknown:
298304
mode: ManualDeployment
299305
label: '{BranchName}'
300306
increment: Inherit
301307
prevent-increment:
302308
when-current-commit-tagged: false
309+
track-merge-message: false
303310
regex: (?<BranchName>.+)
304311
source-branches:
305312
- main
306313
- release
307314
- feature
308315
- pull-request
309316
is-source-branch-for: []
310-
track-merge-message: false
311317
is-main-branch: false
312318
ignore:
313319
sha: []
@@ -328,10 +334,14 @@ tracks-release-branches: false
328334
is-release-branch: false
329335
is-main-branch: false
330336
```
337+
<sup><a href='/docs/workflows/GitHubFlow/v1.yml#L1-L116' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/GitHubFlow/v1.yml' title='Start of snippet'>anchor</a></sup>
338+
<!-- endSnippet -->
331339

332340
The preview built-in configuration (experimental usage only) for the `TrunkBased` workflow (`workflow: TrunkBased/preview1`) looks like:
333341

334-
```yaml
342+
<!-- snippet: /docs/workflows/TrunkBased/preview1.yml -->
343+
<a id='snippet-/docs/workflows/TrunkBased/preview1.yml'></a>
344+
```yml
335345
assembly-versioning-scheme: MajorMinorPatch
336346
assembly-file-versioning-scheme: MajorMinorPatch
337347
tag-prefix: '[vV]?'
@@ -346,55 +356,74 @@ merge-message-formats: {}
346356
update-build-number: true
347357
semantic-version-format: Strict
348358
strategies:
349-
- Mainline
350359
- ConfiguredNextVersion
360+
- Mainline
351361
branches:
352362
main:
353363
mode: ContinuousDeployment
354364
label: ''
355365
increment: Patch
356366
prevent-increment:
357367
of-merged-branch: true
358-
when-current-commit-tagged: true
359368
track-merge-target: false
369+
track-merge-message: true
360370
regex: ^master$|^main$
361371
source-branches: []
372+
is-source-branch-for: []
362373
tracks-release-branches: false
363374
is-release-branch: false
364375
is-main-branch: true
365376
pre-release-weight: 55000
366377
feature:
378+
mode: ContinuousDelivery
379+
label: '{BranchName}'
367380
increment: Minor
368-
regex: ^features?[/-](?<BranchName>.+)
369381
prevent-increment:
370382
when-current-commit-tagged: false
383+
track-merge-message: true
384+
regex: ^features?[/-](?<BranchName>.+)
371385
source-branches:
372386
- main
387+
is-source-branch-for: []
388+
is-main-branch: false
373389
pre-release-weight: 30000
374390
hotfix:
391+
mode: ContinuousDelivery
392+
label: '{BranchName}'
375393
increment: Patch
376-
regex: ^hotfix(es)?[/-](?<BranchName>.+)
377394
prevent-increment:
378395
when-current-commit-tagged: false
396+
regex: ^hotfix(es)?[/-](?<BranchName>.+)
379397
source-branches:
380398
- main
399+
is-source-branch-for: []
400+
is-release-branch: true
401+
is-main-branch: false
381402
pre-release-weight: 30000
382403
pull-request:
383404
mode: ContinuousDelivery
384405
label: PullRequest
385406
increment: Inherit
407+
prevent-increment:
408+
of-merged-branch: true
409+
when-current-commit-tagged: false
386410
label-number-pattern: '[/-](?<number>\d+)'
411+
track-merge-message: true
387412
regex: ^(pull|pull\-requests|pr)[/-]
388413
source-branches:
389414
- main
415+
- feature
416+
- hotfix
417+
is-source-branch-for: []
390418
pre-release-weight: 30000
391419
unknown:
392420
increment: Patch
393-
regex: (?<BranchName>.+)
394421
prevent-increment:
395422
when-current-commit-tagged: false
423+
regex: (?<BranchName>.+)
396424
source-branches:
397425
- main
426+
is-source-branch-for: []
398427
pre-release-weight: 30000
399428
ignore:
400429
sha: []
@@ -409,10 +438,14 @@ track-merge-target: false
409438
track-merge-message: true
410439
commit-message-incrementing: Enabled
411440
regex: ''
441+
source-branches: []
442+
is-source-branch-for: []
412443
tracks-release-branches: false
413444
is-release-branch: false
414445
is-main-branch: false
415446
```
447+
<sup><a href='/docs/workflows/TrunkBased/preview1.yml#L1-L101' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/TrunkBased/preview1.yml' title='Start of snippet'>anchor</a></sup>
448+
<!-- endSnippet -->
416449

417450
The details of the available options are as follows:
418451

0 commit comments

Comments
 (0)