Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .devops/workflows/Test_Devops_Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ jobs:
artifactName: Invex.Atom.Module.GitHubWorkflows.Tests-$(job-runs-on)-$(test-framework)
targetPath: $(Build.BinariesDirectory)/Invex.Atom.Module.GitHubWorkflows.Tests

- task: PublishPipelineArtifact@1
displayName: Invex.Atom.Module.GitVersion.Tests
inputs:
artifactName: Invex.Atom.Module.GitVersion.Tests-$(job-runs-on)-$(test-framework)
targetPath: $(Build.BinariesDirectory)/Invex.Atom.Module.GitVersion.Tests

- task: PublishPipelineArtifact@1
displayName: Invex.Atom.Workflows.Tests
inputs:
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ jobs:
name: 'Invex.Atom.Module.GitHubWorkflows.Tests-${{ matrix.job-runs-on }}-${{ matrix.test-framework }}'
path: '${{ github.workspace }}/.github/publish/Invex.Atom.Module.GitHubWorkflows.Tests'

- name: Store Invex.Atom.Module.GitVersion.Tests
uses: actions/upload-artifact@v7
with:
name: 'Invex.Atom.Module.GitVersion.Tests-${{ matrix.job-runs-on }}-${{ matrix.test-framework }}'
path: '${{ github.workspace }}/.github/publish/Invex.Atom.Module.GitVersion.Tests'

- name: Store Invex.Atom.Workflows.Tests
uses: actions/upload-artifact@v7
with:
Expand Down Expand Up @@ -1112,6 +1118,78 @@ jobs:
name: Invex.Atom.Module.GitHubWorkflows.Tests-macos-latest-net11.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitHubWorkflows.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-windows-latest-net10.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-windows-latest-net11.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-windows-11-arm-net10.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-windows-11-arm-net11.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-ubuntu-latest-net10.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-ubuntu-latest-net11.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-ubuntu-24.04-arm-net10.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-ubuntu-24.04-arm-net11.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-macos-15-intel-net10.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-macos-15-intel-net11.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-macos-latest-net10.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Module.GitVersion.Tests
uses: actions/download-artifact@v8
with:
name: Invex.Atom.Module.GitVersion.Tests-macos-latest-net11.0
path: '${{ github.workspace }}/.github/artifacts/Invex.Atom.Module.GitVersion.Tests'

- name: Retrieve Invex.Atom.Workflows.Tests
uses: actions/download-artifact@v8
with:
Expand Down
237 changes: 124 additions & 113 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,113 +1,124 @@
assembly-informational-format: '{Major}.{Minor}.{Patch}{PreReleaseTagWithDash}'
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber ?? 0}'
mode: ContinuousDelivery
tag-prefix: '[vV]?'

major-version-bump-message: '^(breaking|major)\(?[A-Za-z0-9\-]*\)?:'
minor-version-bump-message: '^(feat|feature|minor)\(?[A-Za-z0-9\-]*\)?:'
patch-version-bump-message: '^(fix|patch)\(?[A-Za-z0-9\-]*\)?:'
no-bump-message: '^(semver-none|semver-skip)'

# Tagged releases get the highest band
tag-pre-release-weight: 6000

branches:

# Prevent default GitFlow configs from matching
feature:
regex: ^$
release:
regex: ^$
hotfix:
regex: ^$
support:
regex: ^$

#####################################
# RELEASE BRANCHES
#####################################

patch:
label: 'rc'
increment: Patch
prevent-increment:
of-merged-branch: true
when-current-commit-tagged: true
track-merge-target: false
track-merge-message: true
regex: ^patch[/-]
is-release-branch: true
is-main-branch: false
pre-release-weight: 5000 # 5,000–5,999

main:
label: 'rc'
increment: Minor
prevent-increment:
of-merged-branch: true
track-merge-target: false
track-merge-message: true
regex: ^master$|^main$
is-release-branch: false
is-main-branch: true
pre-release-weight: 4000 # 4,000–4,999

#####################################
# MAINLINE BRANCHES
#####################################

develop:
label: 'preview'
increment: Minor
prevent-increment:
when-current-commit-tagged: false
track-merge-target: true
track-merge-message: true
regex: ^dev(elop)?(ment)?$
is-release-branch: false
is-main-branch: false
pre-release-weight: 3000 # 3,000–3,999

#####################################
# FEATURE BRANCHES
#####################################

beta-minor:
label: beta.{BranchType}-{BranchName}
increment: Minor
prevent-increment:
when-current-commit-tagged: false
track-merge-target: true
track-merge-message: true
regex: ^(?<BranchType>chore|feat|feature|features|fix|improvement|refactor)[/-](?<BranchName>.+)
is-release-branch: false
is-main-branch: false
pre-release-weight: 2000 # 2,000–2,999

#####################################
# OTHER
#####################################

alpha:
label: alpha.{BranchName}
increment: None
prevent-increment:
when-current-commit-tagged: false
track-merge-target: true
track-merge-message: true
regex: (?<BranchName>.+)
is-release-branch: false
is-main-branch: false
pre-release-weight: 1000 # 1,000–1,999

pull-request:
label: 'pr'
increment: Inherit
prevent-increment:
of-merged-branch: true
when-current-commit-tagged: false
track-merge-message: true
regex: ^(pull|pull\-requests|pr)[/-]
is-release-branch: false
is-main-branch: false
pre-release-weight: 0 # 0–999
calculation:
mode: ContinuousDelivery
tag-prefix: '[vV]?'

major-version-bump-message: '^(breaking|major)\(?[A-Za-z0-9\-]*\)?:'
minor-version-bump-message: '^(feat|feature|minor)\(?[A-Za-z0-9\-]*\)?:'
patch-version-bump-message: '^(fix|patch)\(?[A-Za-z0-9\-]*\)?:'
no-bump-message: '^(semver-none|semver-skip)'

branches:

# Prevent default GitFlow configs from matching
feature:
regex: ^$
release:
regex: ^$
hotfix:
regex: ^$
support:
regex: ^$

#####################################
# RELEASE BRANCHES
#####################################

patch:
label: 'rc'
increment: Patch
prevent-increment:
of-merged-branch: true
when-current-commit-tagged: true
track-merge-target: false
track-merge-message: true
regex: ^patch[/-]
is-release-branch: true
is-main-branch: false

main:
label: 'rc'
increment: Minor
prevent-increment:
of-merged-branch: true
track-merge-target: false
track-merge-message: true
regex: ^master$|^main$
is-release-branch: false
is-main-branch: true

#####################################
# MAINLINE BRANCHES
#####################################

develop:
label: 'preview'
increment: Minor
prevent-increment:
when-current-commit-tagged: false
track-merge-target: true
track-merge-message: true
regex: ^dev(elop)?(ment)?$
is-release-branch: false
is-main-branch: false

#####################################
# FEATURE BRANCHES
#####################################

beta-minor:
label: beta.{BranchType}-{BranchName}
increment: Minor
prevent-increment:
when-current-commit-tagged: false
track-merge-target: true
track-merge-message: true
regex: ^(?<BranchType>chore|feat|feature|features|fix|improvement|refactor)[/-](?<BranchName>.+)
is-release-branch: false
is-main-branch: false

#####################################
# OTHER
#####################################

alpha:
label: alpha.{BranchName}
increment: None
prevent-increment:
when-current-commit-tagged: false
track-merge-target: true
track-merge-message: true
regex: (?<BranchName>.+)
is-release-branch: false
is-main-branch: false

pull-request:
label: 'pr'
increment: Inherit
prevent-increment:
of-merged-branch: true
when-current-commit-tagged: false
track-merge-message: true
regex: ^(pull|pull\-requests|pr)[/-]
is-release-branch: false
is-main-branch: false

output:
assembly-informational-format: '{Major}.{Minor}.{Patch}{PreReleaseLabelWithDash}'
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber ?? 0}'

# Tagged releases get the highest band
tag-pre-release-weight: 6000

branches:
patch:
pre-release-weight: 5000 # 5,000–5,999
main:
pre-release-weight: 4000 # 4,000–4,999
develop:
pre-release-weight: 3000 # 3,000–3,999
beta-minor:
pre-release-weight: 2000 # 2,000–2,999
alpha:
pre-release-weight: 1000 # 1,000–1,999
pull-request:
pre-release-weight: 0 # 0–999
1 change: 1 addition & 0 deletions Invex.Atom.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<Project Path="tests/Invex.Atom.Module.DevOpsWorkflows.Tests/Invex.Atom.Module.DevOpsWorkflows.Tests.csproj" />
<Project Path="tests/Invex.Atom.Module.Dotnet.Tests/Invex.Atom.Module.Dotnet.Tests.csproj" />
<Project Path="tests/Invex.Atom.Module.GitHubWorkflows.Tests/Invex.Atom.Module.GitHubWorkflows.Tests.csproj" />
<Project Path="tests/Invex.Atom.Module.GitVersion.Tests/Invex.Atom.Module.GitVersion.Tests.csproj" />
</Folder>
<Folder Name="/Tests/Tools/">
<Project Path="tests/Invex.Atom.Tool.Tests/Invex.Atom.Tool.Tests.csproj" />
Expand Down
1 change: 1 addition & 0 deletions _atom/Targets/ITestTargets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal interface ITestTargets : IDotnetTestHelper
Projects.Invex_Atom_Module_Dotnet_Tests.Name,
Projects.Invex_Atom_Module_DevOpsWorkflows_Tests.Name,
Projects.Invex_Atom_Module_GitHubWorkflows_Tests.Name,
Projects.Invex_Atom_Module_GitVersion_Tests.Name,
Projects.Invex_Atom_Workflows_Tests.Name,
Projects.Invex_Atom_Tool_Tests.Name,
];
Expand Down
9 changes: 8 additions & 1 deletion docs/modules/git-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@ from GitVersion output.

## Prerequisites

The providers install and run a pinned version of the `GitVersion.Tool` global .NET tool (currently `6.8.2`), so the
The providers install and run a pinned version of the `GitVersion.Tool` global .NET tool (currently `7.0.0`), so the
build doesn't break when a new GitVersion major version changes its command-line arguments or output. If a different
version is installed globally, it is replaced with the pinned version the first time GitVersion is needed.

Configure it via `GitVersion.yml` in your repository root, using the configuration format of the pinned GitVersion
version.

> [!IMPORTANT]
> GitVersion 7 nests settings under `calculation:` and `output:` and rejects the flat GitVersion 6 layout. It also
> renames the pre-release variables: `PreReleaseTag` is now `PreReleaseLabel`, and the old `PreReleaseLabel` is now
> `PreReleaseLabelName`. Migrate a GitVersion 6 configuration with `dotnet gitversion config migrate --in-place`, then
> update any format strings that still use the old names, such as `{PreReleaseTagWithDash}` (now
> `{PreReleaseLabelWithDash}`). The migration drops comments from the file.

## See also

- [Build Info](../core-concepts/build-info.md): the providers GitVersion replaces.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
<ProjectReference Include="..\Invex.Atom.Build.SourceGenerators\Invex.Atom.Build.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Invex.Atom.Module.GitVersion.Tests" />
</ItemGroup>

<ItemGroup>
<None Include="Invex.Atom.Module.GitVersion.props" Pack="true" PackagePath="buildTransitive/" />
</ItemGroup>
Expand Down
Loading
Loading