From 3c7bc8e18307c5dab253cdb7dae506fe3880da3c Mon Sep 17 00:00:00 2001 From: Artur Date: Sat, 5 Nov 2022 16:55:21 +0100 Subject: [PATCH] Merge branch 'support/5.x' into main --- .github/workflows/docs.yml | 17 ++++---- .remarkrc.yaml | 4 +- README.md | 2 +- SECURITY.md | 14 +++---- build/nuspec/README.md | 4 +- .../contribute-examples.md | 6 +-- .../branching-strategies/gitflow/examples.md | 4 -- .../branching-strategies/gitflow/index.md | 18 ++++----- .../githubflow/examples.md | 2 +- .../branching-strategies/githubflow/index.md | 8 ++-- docs/input/docs/learn/credits.md | 6 +-- docs/input/docs/learn/faq.md | 2 +- docs/input/docs/learn/how-it-works.md | 4 +- docs/input/docs/learn/intro-to-semver.md | 6 +-- docs/input/docs/learn/who.md | 1 - .../reference/build-servers/azure-devops.md | 10 ++--- .../docs/reference/build-servers/gitlab.md | 39 ++++++++++--------- .../docs/reference/build-servers/jenkins.md | 10 ++--- .../docs/reference/build-servers/myget.md | 8 ++-- .../docs/reference/build-servers/teamcity.md | 11 +++--- docs/input/docs/reference/configuration.md | 36 ++++++++--------- .../reference/modes/continuous-delivery.md | 6 +-- .../reference/modes/continuous-deployment.md | 2 +- docs/input/docs/reference/modes/mainline.md | 2 +- .../docs/reference/version-increments.md | 4 +- docs/input/docs/usage/ci.md | 4 +- docs/input/docs/usage/cli/arguments.md | 2 +- docs/input/docs/usage/cli/installation.md | 6 +-- package.json | 4 ++ src/Docker/{Readme.md => README.md} | 0 src/Docker/prerequisites.md | 17 ++++++-- ...riteOutEffectiveConfiguration.approved.txt | 2 +- .../ConfigurationProviderTests.cs | 4 +- .../Helpers/GitFlowConfigurationBuilder.cs | 3 +- .../Helpers/GitHubFlowConfigurationBuilder.cs | 3 +- .../Helpers/TestEffectiveConfiguration.cs | 2 +- .../IntegrationTests/MainScenarios.cs | 2 +- .../MergeMessageTests.cs | 2 +- .../SemanticVersionTests.cs | 1 + .../AssemblyInfoFileUpdaterTests.cs | 12 +++--- .../ProjectFileUpdaterTests.cs | 8 ++-- .../Configuration/GitVersionConfiguration.cs | 2 +- .../VersionVariablesJsonNumberConverter.cs | 2 +- src/GitVersion.Core/PublicAPI.Shipped.txt | 2 +- .../SemanticVersioning/SemanticVersion.cs | 2 +- .../AssemblyInfo/ProjectFileUpdater.cs | 10 ++++- 46 files changed, 166 insertions(+), 150 deletions(-) rename src/Docker/{Readme.md => README.md} (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index aadc20a659..b356c23291 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -58,8 +58,11 @@ jobs: key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - name: Get npm cache directory + shell: bash id: cache-node-dir - run: echo "::set-output name=dir::$(npm config get cache)" + run: | + cacheDir=$(npm config get cache) + echo "dir=$cacheDir" >> $GITHUB_OUTPUT - name: Cache Node Modules id: cache-node @@ -118,15 +121,13 @@ jobs: uses: chabad360/htmlproofer@master with: directory: ./artifacts/docs/preview - arguments: --url-ignore /api/ --allow-hash-href --assume-extension --disable-external + arguments: --ignore-urls /api/,/docs/ --allow-hash-href --assume-extension --disable-external - - name: Reviewdog Reporter - uses: haya14busa/action-cond@v1 + name: '[Reviewdog Reporter]' id: reporter - with: - cond: ${{ github.event_name == 'pull_request' }} - if_true: github-pr-review - if_false: github-check + run: | + value=$([ ${{ github.event_name == 'pull_request' }} ] && echo "github-pr-review" || echo "github-check") + echo "value=$value" >> $GITHUB_OUTPUT - name: '[Remark Lint]' uses: reviewdog/action-remark-lint@v5.6 diff --git a/.remarkrc.yaml b/.remarkrc.yaml index 4ca9043aea..cf4ada6d5f 100644 --- a/.remarkrc.yaml +++ b/.remarkrc.yaml @@ -25,12 +25,12 @@ plugins: - remark-lint-no-blockquote-without-marker - remark-lint-no-consecutive-blank-lines - remark-lint-no-duplicate-definitions - - remark-lint-no-duplicate-headings + - remark-lint-no-duplicate-headings: ["warn"] - remark-lint-no-emphasis-as-heading - remark-lint-no-empty-url - remark-lint-no-file-name-articles - remark-lint-no-file-name-consecutive-dashes - - remark-lint-no-file-name-irregular-characters + - remark-lint-no-file-name-irregular-characters: ["warn"] - remark-lint-no-file-name-mixed-case - remark-lint-no-file-name-outer-dashes - remark-lint-no-heading-content-indent diff --git a/README.md b/README.md index d1455a2eab..9ffab598c6 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ works out the [Semantic Version][semver] of the commit being built. | **GitVersion.Portable** | [![Chocolatey][choco-badge]][choco] | | **GitVersion.Tool** | [![NuGet][gvgt-badge]][gvgt] | | **GitVersion.CommandLine** | [![NuGet][gvcl-badge]][gvcl] | -| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | Known as [GitVersionTask] before v5.6.0 | +| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | Known as [GitVersionTask][gitversiontask] before v5.6.0 | | **Homebrew** | [![homebrew][brew-badge]][brew] | | **Azure Pipeline Task** | [![Azure Pipeline Task][az-pipeline-task-badge]][az-pipeline-task] | | **Github Action** | [![Github Action][gh-actions-badge]][gh-actions] | diff --git a/SECURITY.md b/SECURITY.md index d6628eee0c..6e0e279f39 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -17,13 +17,13 @@ You should receive a response within 24 hours. If for some reason you do not, pl Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue +* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. diff --git a/build/nuspec/README.md b/build/nuspec/README.md index 61799b7a1a..108f089325 100644 --- a/build/nuspec/README.md +++ b/build/nuspec/README.md @@ -9,7 +9,7 @@ works out the [Semantic Version][semver] of the commit being built. | :------------------------- | :----------------------------------------------------------------- | - | | **GitVersion.Tool** | [![NuGet][gvgt-badge]][gvgt] | | **GitVersion.CommandLine** | [![NuGet][gvcl-badge]][gvcl] | -| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | Known as [GitVersionTask] before v5.6.0 | +| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | Known as [GitVersionTask][gitversiontask] before v5.6.0 | ## Compatibility @@ -44,8 +44,6 @@ from The Noun Project. [gitter]: https://gitter.im/GitTools/GitVersion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge [gitter-badge]: https://badges.gitter.im/Join+Chat.svg [docs]: https://gitversion.net/docs/ -[gh-rel]: https://github.com/GitTools/GitVersion/releases/latest -[gh-rel-badge]: https://img.shields.io/github/release/gittools/gitversion.svg?logo=github [gvt]: https://www.nuget.org/packages/GitVersion.MsBuild [gvt-badge]: https://img.shields.io/nuget/v/GitVersion.MsBuild.svg?logo=nuget [gitversiontask]: https://www.nuget.org/packages/GitVersionTask/ diff --git a/docs/input/docs/learn/branching-strategies/contribute-examples.md b/docs/input/docs/learn/branching-strategies/contribute-examples.md index 5ce7224cb5..c162dfe85e 100644 --- a/docs/input/docs/learn/branching-strategies/contribute-examples.md +++ b/docs/input/docs/learn/branching-strategies/contribute-examples.md @@ -9,10 +9,8 @@ The examples are generated by GitVersion tests, there are a number of services which will then turn the sequence diagram text into an image to use in the docs. Here are some links which could be useful -* [PlantUML Sequence Diagrams](http://www.plantuml.com/sequence.html) -* [CodeUML Online editor](http://www.codeuml.com/) -* [PlantText Online editor](http://www.planttext.com/planttext) -* [PlantUML gist renderer](http://uml.mvnsearch.org) +* [PlantUML Sequence Diagrams](https://www.plantuml.com/sequence.html) +* [PlantText Online editor](https://www.planttext.com) The tests are quite simple. Using the methods on the `fixture` itself will record that action in the sequence diagram. If you do not want the action diff --git a/docs/input/docs/learn/branching-strategies/gitflow/examples.md b/docs/input/docs/learn/branching-strategies/gitflow/examples.md index 32c3712343..a2915f17bd 100644 --- a/docs/input/docs/learn/branching-strategies/gitflow/examples.md +++ b/docs/input/docs/learn/branching-strategies/gitflow/examples.md @@ -87,10 +87,6 @@ patch _will not_ automatically bump, meaning you have to use hotfix branches. See [contributing examples](/docs/learn/branching-strategies/contribute-examples). -## Complete Example - -![GitFlow](http://uml.mvnsearch.org/gist/cf053d7f5d336ae9f7bb) - ### Source See `DocumentationSamples.GitFlowExample`. To update, modify then run test. diff --git a/docs/input/docs/learn/branching-strategies/gitflow/index.md b/docs/input/docs/learn/branching-strategies/gitflow/index.md index 8c95f757fa..8e0e71dcf5 100644 --- a/docs/input/docs/learn/branching-strategies/gitflow/index.md +++ b/docs/input/docs/learn/branching-strategies/gitflow/index.md @@ -8,17 +8,15 @@ RedirectFrom: docs/git-branching-strategies/gitflow Git Flow allows more structured releases, and GitVersion will derive sensible SemVer compatible versions from this structure. -## Resources - ## Assumptions: -* Using [GitFlow branching model](http://nvie.com/git-model/) which always has a +* Using [GitFlow branching model](https://nvie.com/git-model/) which always has a main and a develop branch -* Following [Semantic Versioning](http://semver.org/) +* Following [Semantic Versioning](https://semver.org/) * Planned releases (bumps in major or minor) are done on release branches prefixed with release-. Eg: release-4.1 (or release-4.1.0) * Hotfixes are prefixed with hotfix- Eg. hotfix-4.0.4 -* The original [GitFlow model](http://nvie.com/posts/a-successful-git-branching-model/) +* The original [GitFlow model](https://nvie.com/posts/a-successful-git-branching-model/) specifies branches with a "-" separator while the [git flow extensions](https://github.com/nvie/gitflow) default to a "/" separator. Either work with GitVersion. * Tags are used on the main branch and reflects the SemVer of each stable @@ -58,7 +56,7 @@ Optional Tags (only when transitioning existing repository): Long version: -``` +```txt {major}.{minor}.{patch} Sha:'{sha}' 1.2.3 Sha:'a682956dccae752aa24597a0f5cd939f93614509' ``` @@ -78,7 +76,7 @@ Long version: Long version: -``` +```txt {major}.{minor}.{patch}-{pre-release} Branch:'{branchName}' Sha:'{sha}' 1.2.3-alpha.645 Branch:'develop' Sha:'a682956dccae752aa24597a0f5cd939f93614509' ``` @@ -97,7 +95,7 @@ Named: `hotfix-{versionNumber}` eg `hotfix-1.2` Long version: -``` +```txt {major}.{minor}.{patch}-{pre-release} Branch:'{branchName}' Sha:'{sha}' 1.2.3-beta645 Branch:'hotfix-foo' Sha:'a682956dccae752aa24597a0f5cd939f93614509' ``` @@ -125,7 +123,7 @@ that tag the version would be `1.2.0-alpha1.4` Long version: -``` +```txt {major}.{minor}.{patch}-{pre-release} Branch:'{branchName}' Sha:'{sha}' 1.2.3-alpha2.4 Branch:'release-1.2' Sha:'a682956dccae752aa24597a0f5cd939f93614509' 1.2.3-rc2 Branch:'release-1.2' Sha:'a682956dccae752aa24597a0f5cd939f93614509' @@ -149,7 +147,7 @@ branches named like "4.0.3" Long version: -``` +```txt {major}.{minor}.{patch}-{pre-release} Branch:'{branchName}' Sha:'{sha}' 1.2.3-alpha.feature-a682956d Branch:'feature1' Sha:'a682956dccae752aa24597a0f5cd939f93614509' ``` diff --git a/docs/input/docs/learn/branching-strategies/githubflow/examples.md b/docs/input/docs/learn/branching-strategies/githubflow/examples.md index 6766feee6b..4a71e6dc4f 100644 --- a/docs/input/docs/learn/branching-strategies/githubflow/examples.md +++ b/docs/input/docs/learn/branching-strategies/githubflow/examples.md @@ -15,7 +15,7 @@ RedirectFrom: docs/git-branching-strategies/githubflow-examples ## Release branch Release branches can be used in GitHubFlow as well as GitFlow. Sometimes you -want to start on a large feature which may take a while to stabilise so you want +want to start on a large feature which may take a while to stabilize so you want to keep it off main. In these scenarios you can either create a long lived feature branch (if you do not know the version number this large feature will go into, and it's non-breaking) otherwise you can create a release branch for the diff --git a/docs/input/docs/learn/branching-strategies/githubflow/index.md b/docs/input/docs/learn/branching-strategies/githubflow/index.md index 513e1dd57b..b7e8d0593d 100644 --- a/docs/input/docs/learn/branching-strategies/githubflow/index.md +++ b/docs/input/docs/learn/branching-strategies/githubflow/index.md @@ -23,7 +23,7 @@ GitHub Flow allows and encourages [continuous delivery](/docs/reference/modes/co ## Resources -* [GitHubFlow guide by GitHub](https://guides.github.com/introduction/flow/index.html) -* [GitHubFlow original blog post](http://scottchacon.com/2011/08/31/github-flow.html) -* [Phil Haack's (haacked) GitHubFlow aliases](http://haacked.com/archive/2014/07/28/github-flow-aliases/) -* [GitHubFlow vs GitFlow](http://lucamezzalira.com/2014/03/10/git-flow-vs-github-flow/) +* [GitHubFlow guide by GitHub](https://docs.github.com/en/get-started/quickstart/github-flow#introduction) +* [GitHubFlow original blog post](https://scottchacon.com/2011/08/31/github-flow.html) +* [Phil Haack's (haacked) GitHubFlow aliases](https://haacked.com/archive/2014/07/28/github-flow-aliases/) +* [GitHubFlow vs GitFlow](https://lucamezzalira.com/2014/03/10/git-flow-vs-github-flow/) diff --git a/docs/input/docs/learn/credits.md b/docs/input/docs/learn/credits.md index 95f5b6a677..d00e906c52 100644 --- a/docs/input/docs/learn/credits.md +++ b/docs/input/docs/learn/credits.md @@ -9,13 +9,13 @@ Icons sourced, with love, from [The Noun Project][the-noun-project]: | Icon | Designer | | :-----------------------------------------: | :--------------------------------------------------------- | | [![Tree][tree-icon]][tree-link] | [Tree][tree-link] by [Davic Chapman][david-chapman] | -| [![Repeat][repeat-icon]][repeat-link] | [Repeat][repeat-link] by [Arthur Shlain][artZ91] | -| [![Terminal][terminal-icon]][terminal-link] | [Terminal][terminal-link] by [Ghayn] | +| [![Repeat][repeat-icon]][repeat-link] | [Repeat][repeat-link] by [Arthur Shlain][artz91] | +| [![Terminal][terminal-icon]][terminal-link] | [Terminal][terminal-link] by [Ghayn][ghayn] | | [![Collect][collect-icon]][collect-link] | [Collect][collect-link] by [Shmidt Sergey][monstercritic] | | [![Library][library-icon]][library-link] | [Library][library-link] by [Kevin Eichhorn][kevineichhorn] | ::: -[artZ91]: https://thenounproject.com/ArtZ91/ +[artz91]: https://thenounproject.com/ArtZ91/ [collect-icon]: /assets/img/collect.svg [collect-link]: https://thenounproject.com/term/collect/424422/ [david-chapman]: https://thenounproject.com/david.chapman/ diff --git a/docs/input/docs/learn/faq.md b/docs/input/docs/learn/faq.md index e69d106a94..631948c857 100644 --- a/docs/input/docs/learn/faq.md +++ b/docs/input/docs/learn/faq.md @@ -30,7 +30,7 @@ be a good primer to read before reading [SemVer.org][semver]. ## I can't use the build number for NuGet If you have used NuGet you would notice the versions above are not compatible -with NuGet. GitVersion solves this by providing [variables]. +with NuGet. GitVersion solves this by providing [variables][variables]. What you have seen above is the `SemVer` variable. You can use the `NuGetVersion` variable to have the version formatted in a NuGet compatible way. diff --git a/docs/input/docs/learn/how-it-works.md b/docs/input/docs/learn/how-it-works.md index 99cf2b75ed..6c3ee2ae1a 100644 --- a/docs/input/docs/learn/how-it-works.md +++ b/docs/input/docs/learn/how-it-works.md @@ -26,9 +26,9 @@ GitVersion has three distinct steps for calculating versions in v3. Visually it looks something like this: -![Version Calculation](http://www.plantuml.com:80/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1\_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK\_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea\_0G00) +![Version Calculation](https://www.plantuml.com/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1\_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK\_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea\_0G00) -[Edit Diagram](http://www.plantuml.com/plantuml/form?url=http://www.plantuml.com/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1\_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK\_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea\_0G00) +[Edit Diagram](https://www.plantuml.com/plantuml/form?url=https://www.plantuml.com/plantuml/png/fLCxJyCm4DxzAsuib4P914i69De1CS38Vd6kYIN7ZcodK8aVp-KX6Y2fKCbY9NV-7lVb2WoOeoVOMRDNfH0lz1vUoNbbpGwrR3K6ws1p3rlk-bN8u972f2AC3GHEbLN8m1D1Jjg-mPuXAZvx9kL1ZW1KY5dOZczMI0Pf54VnHtf7jpaAWJg0sW-uXw4PK3Eb1sMaevfCW6i1\_0m6po1l7HfPJUxvu5XYUOHLWq5MLptCudmMK9--u5glJ0dIEaVo1Dw3JgVM6Km4cM9mzyrQXHuQHnj7chhl0JcnIrHjno1wiWtgfi8eWVK\_7OQAmBHrJWvORFVM2PmrE7AcWZGh-Lj0FvptVvLiUPnCdG_XhNhOov9wQ1fzv7nw5S5EwSvw6CDQNfnMwUAP0XQyQpj70nkx3Nn3p5NFY9IshbNWepKi8ublWFiSPkC0ee8El75Dv5aOxqZQBScbWpWn0Pe2wb6aM1p4Eea\_0G00) **\*** Some strategies allow the version to be incremented, others don't. More info below. diff --git a/docs/input/docs/learn/intro-to-semver.md b/docs/input/docs/learn/intro-to-semver.md index 0a627262fb..179010169c 100644 --- a/docs/input/docs/learn/intro-to-semver.md +++ b/docs/input/docs/learn/intro-to-semver.md @@ -4,7 +4,7 @@ Title: Intro to SemVer RedirectFrom: docs/reference/intro-to-semver --- -For the official Semantic Version docs head to [semver.org](http://semver.org). This is just a quick guide for people getting started and how SemVer is used in GitVersion. +For the official Semantic Version docs head to [semver.org](https://semver.org). This is just a quick guide for people getting started and how SemVer is used in GitVersion. ## Why SemVer? @@ -25,10 +25,10 @@ SemVer introduces conventions about breaking changes into our version numbers so Only one number should be incremented per release, and all lower parts should be reset to 0 (if `{major}` is incremented, then `{minor}` and `{patch}` should become 0). -For a more complete explanation check out [semver.org](http://semver.org) which is the official spec. Remember this is a brief introduction and does not cover all parts of semantic versioning, just the important parts to get started. +For a more complete explanation check out [semver.org](https://semver.org) which is the official spec. Remember this is a brief introduction and does not cover all parts of semantic versioning, just the important parts to get started. ## SemVer in GitVersion -GitVersion makes it easy to follow semantic versioning in your library by automatically calculating the next semantic version which your library/application is likely to use. In [GitFlow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow/) the develop branch will bump the _minor_ when main is tagged, while [GitHubFlow](https://guides.github.com/introduction/flow/) will bump the _patch_. +GitVersion makes it easy to follow semantic versioning in your library by automatically calculating the next semantic version which your library/application is likely to use. In [GitFlow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow/) the develop branch will bump the _minor_ when main is tagged, while [GitHubFlow](https://docs.github.com/en/get-started/quickstart/github-flow#introduction) will bump the _patch_. Because one size does not always fit all, GitVersion provides many [Variables](/docs/reference/variables) for you to use which contain different variations of the version. For example SemVer will be in the format `{major}.{minor}.{patch}-{tag}`, but `FullSemVer` will also include build metadata: `{major}.{minor}.{patch}-{tag}+{buildmetadata}` diff --git a/docs/input/docs/learn/who.md b/docs/input/docs/learn/who.md index eaf925fea8..bbcaba18a8 100644 --- a/docs/input/docs/learn/who.md +++ b/docs/input/docs/learn/who.md @@ -15,7 +15,6 @@ that we know about today. * [NUKE](https://nuke.build) * [Orc.\* packages](https://github.com/wildgums?query=orc) * [Orchestra](https://github.com/wildgums/orchestra) -* [Pomona](http://pomona.io/) * [Shouldly](https://github.com/shouldly/shouldly) * [Akavache](https://github.com/akavache/akavache) * [Splat](https://github.com/paulcbetts/splat) diff --git a/docs/input/docs/reference/build-servers/azure-devops.md b/docs/input/docs/reference/build-servers/azure-devops.md index 2f59695c9d..15fba0b50b 100644 --- a/docs/input/docs/reference/build-servers/azure-devops.md +++ b/docs/input/docs/reference/build-servers/azure-devops.md @@ -37,7 +37,7 @@ the MS Build Task. 5. If you want the GitVersionTask to update AssemblyInfo files add `updateAssemblyInfo true` to the Arguments parameter. 6. If you want to update the build number you need to send a - [logging command](https://github.com/Microsoft/azure-pipelines-tasks/blob/main/docs/authoring/commands.md) + [logging command](https://github.com/microsoft/azure-pipelines-tasks/blob/main/docs/authoring/commands.md) to TFS. ### Using the custom GitVersion build step @@ -57,12 +57,12 @@ to install the GitVersion extension: If you run TFS 2015 RTM or Update 1 or don't want to install the GitVersion extension you can install the build task manually: -1. Install the `tfx` command line tool as shown [here](https://github.com/Microsoft/tfs-cli/blob/main/README.md#install). -2. For TFS 2015 On-Prem configure Basic Authentication in TFS as shown [here](https://github.com/Microsoft/tfs-cli/blob/main/docs/configureBasicAuth.md). +1. Install the `tfx` command line tool as shown [here](https://github.com/microsoft/tfs-cli/blob/master/README.md#setup). +2. For TFS 2015 On-Prem configure Basic Authentication in TFS as shown [here](https://github.com/microsoft/tfs-cli/blob/master/docs/configureBasicAuth.md). 3. Download the GitVersion TFS build task from the latest release on the [GitVersion releases page](https://github.com/GitTools/GitVersion/releases) and unzip. -4. Run `tfx login` as shown [here](https://github.com/Microsoft/tfs-cli/blob/main/README.md#login). +4. Run `tfx login` as shown [here](https://github.com/microsoft/tfs-cli/blob/master/README.md#login). 5. From the directory outside of where you unzipped the task, run `tfx build tasks upload --task-path .\GitVersionVsixTask --overwrite` where GitVersionVsixTask is the directory containing the files. @@ -166,7 +166,7 @@ variables. build but makes sure that all tags are fetched. In the future it is planned to allow using `git.exe` instead of current `libgit2sharp` for syncing the repos which might allow other possibilities to solve this issue. For details see this - [GitHub issue](https://github.com/Microsoft/azure-pipelines-tasks/issues/1218). + [GitHub issue](https://github.com/microsoft/azure-pipelines-tasks/issues/1218). * If running a build for a certain commit (through passing the commit SHA while queueing the build) all tags from the repository will be fetched, even the ones newer than the commit. This can lead to different version numbers while diff --git a/docs/input/docs/reference/build-servers/gitlab.md b/docs/input/docs/reference/build-servers/gitlab.md index 62df6a147a..b9495856e7 100755 --- a/docs/input/docs/reference/build-servers/gitlab.md +++ b/docs/input/docs/reference/build-servers/gitlab.md @@ -9,25 +9,26 @@ To use GitVersion with GitLab CI, either use the [MSBuild Task](/docs/usage/msbuild) or put the GitVersion executable in your runner's `PATH`. -A working example of integrating GitVersion with GitLab is maintained in the project [Utterly Automated Software and Artifact Versioning with GitVersion][] +A working example of integrating GitVersion with GitLab is maintained in the project [Utterly Automated Versioning][utterly-automated-versioning] -Here is a summary of what it demonstrated (many more details in the [README.md][]) +Here is a summary of what it demonstrated (many more details in the [Readme][readme]) -- Is a reusable working example known as a Guided Exploration ([GE Manifesto][]) - so job logs and package artifacts can be reviewed. The project can also be imported to your own GitLab group or instance as a starting point for your own work. -- IMPORTANT: It demonstrates how to override GitLab CI's default cloning behavior so that GitVersion can do a dynamic copy. Selectively clones GitVersion.yml so that these settings take effect. This best practice demonstrates the best way to do this while avoiding a double-cloning of the project (once by GitLab Runner and once by GitVersion). -- Implements GitVersion as a CI/CD Extension that can be reused across many projects using includes. -- Implements GitVersion as a single job that runs the GitVersion container and passes the version number downstream into both _pipeline_ and _job_ level variables, which means... -- It can be used with ANY coding language, framework or packaging engine. -- Generates example packaged artifacts: - - Two ways of building Sem Versioned NuGet packages (msbuild-ish and nuget.exe-ish) and uploads them and tests them from a [GitLab NuGet repository][]. - - A Sem Versioned [GitLab Generic Package][] - - A Sem Versioned docker container and uploads to [GitLabs Container Registry][]. -- It creates a Sem Versioned [GitLab Release](GitLab Releases Feature Help) and Git tag using the [GitLab release-cli][] and links the generic package as evidence. +- Is a reusable working example known as a Guided Exploration ([Guided Exploration Manifesto][guided-exploration-manifesto]) - so job logs and package artifacts can be reviewed. The project can also be imported to your own GitLab group or instance as a starting point for your own work. +- IMPORTANT: It demonstrates how to override GitLab CI's default cloning behavior so that GitVersion can do a dynamic copy. Selectively clones GitVersion.yml so that these settings take effect. This best practice demonstrates the best way to do this while avoiding a double-cloning of the project (once by GitLab Runner and once by GitVersion). +- Implements GitVersion as a CI/CD Extension that can be reused across many projects using includes. +- Implements GitVersion as a single job that runs the GitVersion container and passes the version number downstream into both _pipeline_ and _job_ level variables, which means... +- It can be used with ANY coding language, framework or packaging engine. +- Generates example packaged artifacts: + - Two ways of building Sem Versioned NuGet packages (msbuild-ish and nuget.exe-ish) and uploads them and tests them from a [GitLab NuGet Repository][gitlab-nuget-repository]. + - A Sem Versioned [GitLab Generic Package][gitlab-generic-package] + - A Sem Versioned docker container and uploads to [GitLab Container Registry][gitlab-container-registry]. +- It creates a Sem Versioned [GitLab Release][gitlab-release-help] and Git tag using the [GitLab Release Cli][gitlab-release-cli] and links the generic package as evidence. -[GitLab Generic Package]: https://docs.gitlab.com/ee/user/packages/generic_packages/ -[GitLab NuGet repository]: https://docs.gitlab.com/ee/user/packages/nuget_repository/ -[GitLab release-cli]: https://gitlab.com/gitlab-org/release-cli/-/tree/master/docs -[GitLabs Container Registry]: https://docs.gitlab.com/ee/user/packages/container_registry/ -[GE Manifesto]: https://gitlab.com/guided-explorations/guided-exploration-concept/-/blob/master/README.md -[README.md]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/-/blob/develop/README.md -[Utterly Automated Software and Artifact Versioning with GitVersion]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/ +[gitlab-generic-package]: https://docs.gitlab.com/ee/user/packages/generic_packages/ +[gitlab-nuget-repository]: https://docs.gitlab.com/ee/user/packages/nuget_repository/ +[gitlab-release-cli]: https://gitlab.com/gitlab-org/release-cli/-/tree/master/docs +[gitlab-container-registry]: https://docs.gitlab.com/ee/user/packages/container_registry/ +[guided-exploration-manifesto]: https://gitlab.com/guided-explorations/guided-exploration-concept/-/blob/master/README.md +[readme]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/-/blob/develop/README.md +[utterly-automated-versioning]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/ +[gitlab-release-help]: https://docs.gitlab.com/ee/user/project/releases/ diff --git a/docs/input/docs/reference/build-servers/jenkins.md b/docs/input/docs/reference/build-servers/jenkins.md index 7881d11aae..46b6355a29 100644 --- a/docs/input/docs/reference/build-servers/jenkins.md +++ b/docs/input/docs/reference/build-servers/jenkins.md @@ -25,10 +25,10 @@ Integrating GitVersion into your Jenkins build varies based on the project type: Injecting environment variables is not supported in Jenkins natively, but Jenkins plugins exist that provide this functionality. Of these plugins -[EnvInject] appears to be the most popular with over 20k downloads per month. +[EnvInject][env-inject] appears to be the most popular with over 20k downloads per month. To inject the GitVersion variables as environment variables for a build job -using [EnvInject], do the following: +using [EnvInject][env-inject], do the following: 1. Add an **Execute Windows batch command** build step with _Command_: `gitversion /output buildserver` @@ -51,7 +51,7 @@ You can verify correct injection of environment variables by adding another ### Pipeline Projects -For pipeline projects, GitVersion variables can be accessed by reading the `gitversion.properties` file using the [Pipeline Utility Steps] plugin. Variables from a property file are not automatically merged with the environment variables, but they can be accessed within a script block. +For pipeline projects, GitVersion variables can be accessed by reading the `gitversion.properties` file using the [Pipeline Utility Steps][pipeline-utility-steps] plugin. Variables from a property file are not automatically merged with the environment variables, but they can be accessed within a script block. In a pipeline stage: @@ -75,5 +75,5 @@ script { } ``` -[EnvInject]: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin -[Pipeline Utility Steps]: https://plugins.jenkins.io/pipeline-utility-steps +[env-inject]: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin +[pipeline-utility-steps]: https://plugins.jenkins.io/pipeline-utility-steps diff --git a/docs/input/docs/reference/build-servers/myget.md b/docs/input/docs/reference/build-servers/myget.md index 9ae0d60152..383d61408a 100644 --- a/docs/input/docs/reference/build-servers/myget.md +++ b/docs/input/docs/reference/build-servers/myget.md @@ -8,16 +8,16 @@ RedirectFrom: docs/build-server-support/build-server/myget MyGet Build Services has built-in support for GitVersion and is encouraging you to leverage GitVersion + GitFlow to produce Semantically Versioned packages. -* Create a [custom build script](http://docs.myget.org/docs/reference/custom-build-scripts): +* Create a [custom build script](https://docs.myget.org/docs/reference/custom-build-scripts): we advise to run a tool like GitVersion in a _pre-build_ script, so that it can set additional environment variables for the actual build script. MyGet - [by convention](http://docs.myget.org/docs/reference/build-services#Pre-\_and_post-build_steps) + [by convention](https://docs.myget.org/docs/reference/build-services#Pre-\_and_post-build_steps) automatically picks up any of the following file names as pre-build script: * `pre-build.(bat|cmd|ps1)` * `pre-myget.(bat|cmd|ps1)` * Run `GitVersion /output buildserver`: this will cause MyGet Build Services to set the current `%PackageVersion%` value to the NuGet-compatible SemVer - generated by GitVersion and apply this [MyGet Environment Variable](http://docs.myget.org/docs/reference/build-services#Available_Environment_Variables) + generated by GitVersion and apply this [MyGet Environment Variable](https://docs.myget.org/docs/reference/build-services#Available_Environment_Variables) wherever it is used during the build process. * Ensure the build script has been pushed to your source repository root. Done :) @@ -31,5 +31,5 @@ example using the command: `call %GitVersion% /updateassemblyinfo true`. ::: -Also check [docs.myget.org](http://docs.myget.org/docs/reference/build-services#GitVersion_and_Semantic_Versioning) +Also check [docs.myget.org](https://docs.myget.org/docs/reference/build-services#GitVersion_and_Semantic_Versioning) for the latest full info. diff --git a/docs/input/docs/reference/build-servers/teamcity.md b/docs/input/docs/reference/build-servers/teamcity.md index f100cb810a..55d663cc8d 100644 --- a/docs/input/docs/reference/build-servers/teamcity.md +++ b/docs/input/docs/reference/build-servers/teamcity.md @@ -7,7 +7,7 @@ RedirectFrom: docs/build-server-support/build-server/teamcity ## Basic Usage -In [TeamCity] you can create a build step as follows: +In [TeamCity][teamcity] you can create a build step as follows: * **Runner type:** Command Line * **Run:** Executable with parameters @@ -26,7 +26,6 @@ TeamCity has support for meta-runners which allow custom tasks. There is a [GitVersion meta-runner][meta-runner] available which makes it easy to use GitVersion. - ## Running inside TeamCity When running in TeamCity you have two options, run using **agent checkout** or @@ -70,7 +69,7 @@ See [dynamic repositories][dynamic-repo] for more info. ### NuGet in TeamCity -* Add a dummy [parameter] to the project called `GitVersion.NuGetVersion`. If +* Add a dummy [parameter][parameter] to the project called `GitVersion.NuGetVersion`. If many of your projects uses git-flow and SemVer you can add the parameter to the "root-project" (TeamCity 8.x+). You need a dummy param because GitVersion creates the variables at runtime, and you cannot reference a @@ -104,9 +103,9 @@ Sorry * [Continuous Delivery Setup in TeamCity][cd] -[cd]: http://jake.ginnivan.net/blog/2014/07/09/my-typical-teamcity-build-setup +[cd]: https://jake.ginnivan.net/blog/2014/07/09/my-typical-teamcity-build-setup [dynamic-repo]: /docs/learn/dynamic-repositories -[general-settings]: https://www.jetbrains.com/help/teamcity/git.html#Git-GeneralSettings -[parameter]: http://confluence.jetbrains.com/display/TCD8/Configuring+Build+Parameters +[general-settings]: https://www.jetbrains.com/help/teamcity/git.html#General+Settings +[parameter]: https://confluence.jetbrains.com/display/TCD8/Configuring+Build+Parameters [teamcity]: https://www.jetbrains.com/teamcity/ [meta-runner]: https://github.com/JetBrains/meta-runner-power-pack/tree/master/gitversion diff --git a/docs/input/docs/reference/configuration.md b/docs/input/docs/reference/configuration.md index f586f821a1..bc16c49f2b 100644 --- a/docs/input/docs/reference/configuration.md +++ b/docs/input/docs/reference/configuration.md @@ -32,7 +32,7 @@ To see the effective configuration (defaults and overrides), you can run `gitversion /showConfig`. To create your config file just type `gitversion init` in your repo directory, -after [installing]. A minimal `GitVersion.yml` configuration file will be +after [installing][installing]. A minimal `GitVersion.yml` configuration file will be created. Modify this to suit your needs. ## Global configuration @@ -100,7 +100,7 @@ skip updating the `AssemblyFileVersion` while still updating the Specifies the format of `AssemblyFileVersion` and overwrites the value of `assembly-file-versioning-scheme`. -Expressions in curly braces reference one of the [variables] +Expressions in curly braces reference one of the [variables][variables] or a process-scoped environment variable (when prefixed with `env:`). For example, ```yaml @@ -263,9 +263,9 @@ merge-message-formats: The regular expression should contain the following capture groups: -* `SourceBranch` - Identifies the source branch of the merge -* `TargetBranch` - Identifies the target branch of the merge -* `PullRequestNumber` - Captures the pull-request number +* `SourceBranch` - Identifies the source branch of the merge +* `TargetBranch` - Identifies the target branch of the merge +* `PullRequestNumber` - Captures the pull-request number Custom merge message formats are evaluated _before_ any built in formats. Support for [Conventional Commits][conventional-commits] can be @@ -391,16 +391,16 @@ Take this commit graph By looking at this graph, you cannot tell which of these scenarios happened: -* feature/foo branches off release/v1.0.0 - * Branch release/v1.0.0 from main - * Branch feature/foo from release/v1.0.0 - * Add a commit to both release/v1.0.0 and feature/foo - * release/v1.0.0 is the base for feature/foo -* release/v1.0.0 branches off feature/foo - * Branch feature/foo from main - * Branch release/v1.0.0 from feature/foo - * Add a commit to both release/v1.0.0 and feature/foo - * feature/foo is the base for release/v1.0.0 +* feature/foo branches off release/v1.0.0 + * Branch release/v1.0.0 from main + * Branch feature/foo from release/v1.0.0 + * Add a commit to both release/v1.0.0 and feature/foo + * release/v1.0.0 is the base for feature/foo +* release/v1.0.0 branches off feature/foo + * Branch feature/foo from main + * Branch release/v1.0.0 from feature/foo + * Add a commit to both release/v1.0.0 and feature/foo + * feature/foo is the base for release/v1.0.0 Or put more simply, you cannot tell which branch was created first, `release/v1.0.0` or `feature/foo`. @@ -527,7 +527,7 @@ default `main` and `support/*` are mainlines. ### pre-release-weight -Provides a way to translate the `PreReleaseLabel` ([variables]) to a numeric +Provides a way to translate the `PreReleaseLabel` ([variables][variables]) to a numeric value in order to avoid version collisions across different branches. For example, a release branch created after "1.2.3-alpha.55" results in "1.2.3-beta.1" and thus e.g. "1.2.3-alpha.4" and "1.2.3-beta.4" would have the @@ -536,8 +536,8 @@ same file version: "1.2.3.4". One of the ways to use this value is to set {Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber}`. If the `pre-release-weight` is set, it would be added to the `PreReleaseNumber` to get a final `AssemblySemFileVer`, otherwise a branch specific default for -`pre-release-weight` will be used in the calculation. Related Issues [1145] -and [1366]. +`pre-release-weight` will be used in the calculation. Related Issues [1145][1145] +and [1366][1366]. ### semver-format diff --git a/docs/input/docs/reference/modes/continuous-delivery.md b/docs/input/docs/reference/modes/continuous-delivery.md index 8d321a2dcb..b8d306fb42 100644 --- a/docs/input/docs/reference/modes/continuous-delivery.md +++ b/docs/input/docs/reference/modes/continuous-delivery.md @@ -42,7 +42,7 @@ to deploy to production at any time. By default, GitVersion is set up to do Continuous Delivery on all branches but `develop`, which is set up with [Continuous Deployment][continuous-deployment]. To change the mode to Continuous Delivery, change your -[configuration] to: +[configuration][configuration] to: ```yaml mode: ContinuousDelivery @@ -69,8 +69,8 @@ an external manual process. * [Continuous Delivery on Wikipedia][wikipedia] * [Continuous Delivery, the book][book] -[book]: http://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912 +[book]: https://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912 [configuration]: /docs/reference/configuration -[continuous-deployment]: continuous-deployment +[continuous-deployment]: /docs/reference/modes/continuous-deployment [mainline]: /docs/reference/modes/mainline [wikipedia]: https://en.wikipedia.org/wiki/Continuous_delivery diff --git a/docs/input/docs/reference/modes/continuous-deployment.md b/docs/input/docs/reference/modes/continuous-deployment.md index b6513ee8c4..999256d779 100644 --- a/docs/input/docs/reference/modes/continuous-deployment.md +++ b/docs/input/docs/reference/modes/continuous-deployment.md @@ -38,7 +38,7 @@ giving you the features of GitVersion with continuous deployment: mode: ContinuousDeployment ``` -[blog]: http://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions +[blog]: https://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions [configuration]: /docs/reference/configuration [continuous-delivery]: /docs/reference/modes/continuous-delivery [mainline]: /docs/reference/modes/mainline diff --git a/docs/input/docs/reference/modes/mainline.md b/docs/input/docs/reference/modes/mainline.md index 47980b13b7..3c882715a9 100644 --- a/docs/input/docs/reference/modes/mainline.md +++ b/docs/input/docs/reference/modes/mainline.md @@ -62,7 +62,7 @@ slowing down. By default GitVersion is set up to do [Continuous Delivery][continuous-delivery] versioning on all branches but `develop` (which does [Continuous Deployment][continuous-deployment] by default). To change the [versioning -mode][modes] to Mainline Development, just change the [configuration] as such: +mode][modes] to Mainline Development, just change the [configuration][configuration] as such: ```yaml mode: Mainline diff --git a/docs/input/docs/reference/version-increments.md b/docs/input/docs/reference/version-increments.md index d81d053d38..3dac968bd4 100644 --- a/docs/input/docs/reference/version-increments.md +++ b/docs/input/docs/reference/version-increments.md @@ -130,7 +130,7 @@ explicitly tagged as stable. Then the build metadata (which is the commit count) is promoted to the pre-release tag. Applying these rules, the above commit-graph would produce: -``` +```log e137e9 -> 1.0.0+0 a5f6c5 -> 1.0.1-ci.1 adb29a -> 1.0.1-feature-foo.1 (PR #5 Version: `1.0.1-PullRequest.5+2`) @@ -148,7 +148,7 @@ will produce a stable `2.0.0` package. For more information/background on why we have come to this conclusion, read [Xavier Decoster's blog post on the subject][auto-incremented-nuget-package]. -[auto-incremented-nuget-package]: http://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions +[auto-incremented-nuget-package]: https://www.xavierdecoster.com/semantic-versioning-auto-incremented-nuget-package-versions [continuous-delivery]: /docs/reference/modes/continuous-delivery [conventional-commits]: https://www.conventionalcommits.org/ [faq-branch-name-source]: /docs/learn/faq#merged-branch-names-as-version-source diff --git a/docs/input/docs/usage/ci.md b/docs/input/docs/usage/ci.md index 21240f82af..95b4106329 100644 --- a/docs/input/docs/usage/ci.md +++ b/docs/input/docs/usage/ci.md @@ -29,8 +29,8 @@ GitVersion into an Azure DevOps build pipeline. ## GitLab CI Pipelines -The GitLab CI example [Utterly Automated Software and Artifact Versioning with GitVersion][] implements GitVersion support at the pipeline level by using a single job that runs the GitVersion container and passes the version number downstream into both _pipeline_ and _job_ level variables. It is also implemented as a reusable CI/CD Extension that can be included in many different projects. +The GitLab CI example [gitlab-sample][] implements GitVersion support at the pipeline level by using a single job that runs the GitVersion container and passes the version number downstream into both _pipeline_ and _job_ level variables. It is also implemented as a reusable CI/CD Extension that can be included in many different projects. [gittools-actions]: https://github.com/marketplace/actions/gittools [gittools-task]: https://marketplace.visualstudio.com/items?itemName=gittools.gittools -[Utterly Automated Software and Artifact Versioning with GitVersion]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/ +[gitlab-sample]: https://gitlab.com/guided-explorations/devops-patterns/utterly-automated-versioning/ diff --git a/docs/input/docs/usage/cli/arguments.md b/docs/input/docs/usage/cli/arguments.md index 0746b52c1a..d48fca32a1 100644 --- a/docs/input/docs/usage/cli/arguments.md +++ b/docs/input/docs/usage/cli/arguments.md @@ -15,7 +15,7 @@ Example: `-output json` vs. `/output json` Below is the output from `gitversion /help` as a best effort to provide documentation for which arguments GitVersion supports and their meaning. -``` +```bash Use convention to derive a SemVer product version from a GitFlow or GitHub based repository. diff --git a/docs/input/docs/usage/cli/installation.md b/docs/input/docs/usage/cli/installation.md index 9005b3294a..1ea0ac2aab 100644 --- a/docs/input/docs/usage/cli/installation.md +++ b/docs/input/docs/usage/cli/installation.md @@ -45,7 +45,7 @@ of writing: Linux and macOS). ### Chocolatey -Available on [Chocolatey](http://chocolatey.org) as +Available on [Chocolatey](https://chocolatey.org) as [`GitVersion.Portable`][choco]. ```shell @@ -84,7 +84,7 @@ of writing: Linux, macOS, Windows). [dotnet-tool]: https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools#install-a-global-tool [tool]: https://www.nuget.org/packages/GitVersion.Tool/ -[brew]: https://formulae.brew.sh/formula-linux/gitversion +[brew]: https://formulae.brew.sh/formula/gitversion [homebrew]: https://brew.sh/ [docker]: https://hub.docker.com/r/gittools/gitversion -[choco]: http://chocolatey.org/packages/GitVersion.Portable +[choco]: https://chocolatey.org/packages/GitVersion.Portable diff --git a/package.json b/package.json index 46a3ea7e68..530ce34027 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,10 @@ "name": "gitversion", "description": "From `git log` to SemVer in no time", "main": "index.js", + "scripts": { + "check": "remark . --quiet --frail", + "format": "remark . --output" + }, "directories": { "doc": "docs", "test": "tests" diff --git a/src/Docker/Readme.md b/src/Docker/README.md similarity index 100% rename from src/Docker/Readme.md rename to src/Docker/README.md diff --git a/src/Docker/prerequisites.md b/src/Docker/prerequisites.md index f671ec6e65..5d773a44ea 100644 --- a/src/Docker/prerequisites.md +++ b/src/Docker/prerequisites.md @@ -1,9 +1,20 @@ -# set buildx as the default docker builder +# Run with qemu + +## set buildx as the default docker builder + +```bash docker buildx install +``` -# create and use a docker buildx context +## create and use a docker buildx context + +```bash docker buildx create --name gitversion --use docker context use gitversion +``` + +## install qemu static -# install qemu static +```bash docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +``` diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt index f141ccc585..f2943e4f82 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt +++ b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.CanWriteOutEffectiveConfiguration.approved.txt @@ -1,7 +1,7 @@ assembly-versioning-scheme: MajorMinorPatch assembly-file-versioning-scheme: MajorMinorPatch mode: ContinuousDelivery -tag-prefix: '[vV]' +tag-prefix: '[vV]?' continuous-delivery-fallback-tag: ci major-version-bump-message: '\+semver:\s?(breaking|major)' minor-version-bump-message: '\+semver:\s?(feature|minor)' diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs index cbe5d2f923..b1f7dba626 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs +++ b/src/GitVersion.Core.Tests/Configuration/ConfigurationProviderTests.cs @@ -455,7 +455,7 @@ public void ShouldUseDefaultTagPrefixWhenNotSetInConfigFile() SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath); - configuration.TagPrefix.ShouldBe("[vV]"); + configuration.TagPrefix.ShouldBe(GitVersionConfiguration.DefaultTagPrefix); } [Test] @@ -485,7 +485,7 @@ public void ShouldNotOverrideDefaultTagPrefixWhenNotSetInOverrideConfig() SetupConfigFileContent(text); var configuration = this.configurationProvider.Provide(this.repoPath, new GitVersionConfiguration { TagPrefix = null }); - configuration.TagPrefix.ShouldBe("[vV]"); + configuration.TagPrefix.ShouldBe(GitVersionConfiguration.DefaultTagPrefix); } [Test] diff --git a/src/GitVersion.Core.Tests/Helpers/GitFlowConfigurationBuilder.cs b/src/GitVersion.Core.Tests/Helpers/GitFlowConfigurationBuilder.cs index 09028e451b..6b015df2e7 100644 --- a/src/GitVersion.Core.Tests/Helpers/GitFlowConfigurationBuilder.cs +++ b/src/GitVersion.Core.Tests/Helpers/GitFlowConfigurationBuilder.cs @@ -1,3 +1,4 @@ +using GitVersion.Configuration; using GitVersion.Extensions; using GitVersion.VersionCalculation; @@ -13,7 +14,7 @@ private GitFlowConfigurationBuilder() { AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch, AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch, - TagPrefix = "[vV]", + TagPrefix = GitVersionConfiguration.DefaultTagPrefix, VersioningMode = VersioningMode.ContinuousDelivery, ContinuousDeploymentFallbackTag = "ci", MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern, diff --git a/src/GitVersion.Core.Tests/Helpers/GitHubFlowConfigurationBuilder.cs b/src/GitVersion.Core.Tests/Helpers/GitHubFlowConfigurationBuilder.cs index 49de2d5e6c..e0dffb8542 100644 --- a/src/GitVersion.Core.Tests/Helpers/GitHubFlowConfigurationBuilder.cs +++ b/src/GitVersion.Core.Tests/Helpers/GitHubFlowConfigurationBuilder.cs @@ -1,3 +1,4 @@ +using GitVersion.Configuration; using GitVersion.Extensions; using GitVersion.VersionCalculation; @@ -13,7 +14,7 @@ private GitHubFlowConfigurationBuilder() { AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch, AssemblyFileVersioningScheme = AssemblyFileVersioningScheme.MajorMinorPatch, - TagPrefix = "[vV]", + TagPrefix = GitVersionConfiguration.DefaultTagPrefix, VersioningMode = VersioningMode.ContinuousDelivery, ContinuousDeploymentFallbackTag = "ci", MajorVersionBumpMessage = IncrementStrategyFinder.DefaultMajorPattern, diff --git a/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs b/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs index 5807d33553..5a419c1c58 100644 --- a/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs +++ b/src/GitVersion.Core.Tests/Helpers/TestEffectiveConfiguration.cs @@ -13,7 +13,7 @@ public TestEffectiveConfiguration( string? assemblyFileVersioningFormat = null, string? assemblyInformationalFormat = null, VersioningMode versioningMode = VersioningMode.ContinuousDelivery, - string tagPrefix = "v", + string tagPrefix = "v?", string tag = "", string? nextVersion = null, string branchPrefixToTrim = "", diff --git a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs index 1e3e070273..115db47b93 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs @@ -210,7 +210,7 @@ public void CanSpecifyTagPrefixes() [Test] public void CanSpecifyTagPrefixesAsRegex() { - var configuration = new GitVersionConfiguration { TagPrefix = "version-|[vV]" }; + var configuration = new GitVersionConfiguration { TagPrefix = $"version-|{GitVersionConfiguration.DefaultTagPrefix}" }; using var fixture = new EmptyRepositoryFixture(); var taggedVersion = "v1.0.3"; fixture.Repository.MakeATaggedCommit(taggedVersion); diff --git a/src/GitVersion.Core.Tests/MergeMessageTests.cs b/src/GitVersion.Core.Tests/MergeMessageTests.cs index 332e2eeaa4..ef7a38ede4 100644 --- a/src/GitVersion.Core.Tests/MergeMessageTests.cs +++ b/src/GitVersion.Core.Tests/MergeMessageTests.cs @@ -8,7 +8,7 @@ namespace GitVersion.Core.Tests; [TestFixture] public class MergeMessageTests : TestBase { - private readonly GitVersionConfiguration configuration = new() { TagPrefix = "[vV]" }; + private readonly GitVersionConfiguration configuration = new() { TagPrefix = GitVersionConfiguration.DefaultTagPrefix }; [Test] public void NullMessageStringThrows() => diff --git a/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs index ec70ad3c52..86e9b20a39 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/SemanticVersionTests.cs @@ -66,6 +66,7 @@ public void ValidateVersionParsing( [TestCase("someText")] [TestCase("some-T-ext")] [TestCase("v.1.2.3", "v")] + [TestCase("1.2.3", "v")] public void ValidateInvalidVersionParsing(string versionString, string? tagPrefixRegex = null) => Assert.IsFalse(SemanticVersion.TryParse(versionString, tagPrefixRegex, out _), "TryParse Result"); diff --git a/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs b/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs index 34a583953f..a562132387 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersion.Core.Tests/VersionConverters/AssemblyInfoFileUpdaterTests.cs @@ -40,7 +40,7 @@ public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(strin var workingDir = Path.GetTempPath(); var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v?"), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); @@ -56,7 +56,7 @@ public void ShouldCreateAssemblyInfoFileAtPathWhenNotExistsAndEnsureAssemblyInfo var workingDir = Path.GetTempPath(); var assemblyInfoFile = PathHelper.Combine("src", "Project", "Properties", $"VersionAssemblyInfo.{fileExtension}"); var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v?"), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); @@ -75,7 +75,7 @@ public void ShouldCreateAssemblyInfoFilesAtPathWhenNotExistsAndEnsureAssemblyInf "AssemblyInfo." + fileExtension, PathHelper.Combine("src", "Project", "Properties", "VersionAssemblyInfo." + fileExtension) }; - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v?"), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFiles.ToArray())); @@ -95,7 +95,7 @@ public void ShouldNotCreateAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo var workingDir = Path.GetTempPath(); var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v?"), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFile)); @@ -110,7 +110,7 @@ public void ShouldNotCreateAssemblyInfoFileForUnknownSourceCodeAndEnsureAssembly var workingDir = Path.GetTempPath(); const string assemblyInfoFile = "VersionAssemblyInfo.js"; var fullPath = PathHelper.Combine(workingDir, assemblyInfoFile); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v?"), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, true, assemblyInfoFile)); @@ -124,7 +124,7 @@ public void ShouldStartSearchFromWorkingDirectory() this.fileSystem = Substitute.For(); var workingDir = Path.GetTempPath(); var assemblyInfoFiles = Array.Empty(); - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v?"), new TestEffectiveConfiguration(), false); using var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(this.log, this.fileSystem); assemblyInfoFileUpdater.Execute(variables, new AssemblyInfoContext(workingDir, false, assemblyInfoFiles.ToArray())); diff --git a/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs b/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs index fec03d1439..8b0da9cca0 100644 --- a/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs +++ b/src/GitVersion.Core.Tests/VersionConverters/ProjectFileUpdaterTests.cs @@ -142,7 +142,7 @@ public void CannotUpdateProjectFileWithoutAPropertyGroup(string xml) )] public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v?"), new TestEffectiveConfiguration(), false); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); @@ -169,7 +169,7 @@ public void UpdateProjectXmlVersionElementWithStandardXmlInsertsElement(string x )] public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v?"), new TestEffectiveConfiguration(), false); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); @@ -199,7 +199,7 @@ public void UpdateProjectXmlVersionElementWithStandardXmlModifiesElement(string )] public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLastElement(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v?"), new TestEffectiveConfiguration(), false); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); @@ -230,7 +230,7 @@ public void UpdateProjectXmlVersionElementWithDuplicatePropertyGroupsModifiesLas )] public void UpdateProjectXmlVersionElementWithMultipleVersionElementsLastOneIsModified(string xml) { - var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v"), new TestEffectiveConfiguration(), false); + var variables = this.variableProvider.GetVariablesFor(SemanticVersion.Parse("2.0.0", "v?"), new TestEffectiveConfiguration(), false); var xmlRoot = XElement.Parse(xml); variables.AssemblySemVer.ShouldNotBeNull(); ProjectFileUpdater.UpdateProjectVersionElement(xmlRoot, ProjectFileUpdater.AssemblyVersionElement, variables.AssemblySemVer); diff --git a/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs b/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs index 497a366258..3db85ce0f5 100644 --- a/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs +++ b/src/GitVersion.Core/Configuration/GitVersionConfiguration.cs @@ -97,7 +97,7 @@ public override string ToString() return stringBuilder.ToString(); } - public const string DefaultTagPrefix = "[vV]"; + public const string DefaultTagPrefix = "[vV]?"; public const string ReleaseBranchRegex = "^releases?[/-]"; public const string FeatureBranchRegex = "^features?[/-]"; public const string PullRequestRegex = @"^(pull|pull\-requests|pr)[/-]"; diff --git a/src/GitVersion.Core/OutputVariables/VersionVariablesJsonNumberConverter.cs b/src/GitVersion.Core/OutputVariables/VersionVariablesJsonNumberConverter.cs index 5bd68e160a..6273f39be9 100644 --- a/src/GitVersion.Core/OutputVariables/VersionVariablesJsonNumberConverter.cs +++ b/src/GitVersion.Core/OutputVariables/VersionVariablesJsonNumberConverter.cs @@ -34,7 +34,7 @@ public override void Write(Utf8JsonWriter writer, string? value, JsonSerializerO { writer.WriteNullValue(); } - else if (int.TryParse(value, out var number)) + else if (long.TryParse(value, out var number)) { writer.WriteNumberValue(number); } diff --git a/src/GitVersion.Core/PublicAPI.Shipped.txt b/src/GitVersion.Core/PublicAPI.Shipped.txt index a05ee98e2e..c8b8b5622f 100644 --- a/src/GitVersion.Core/PublicAPI.Shipped.txt +++ b/src/GitVersion.Core/PublicAPI.Shipped.txt @@ -28,7 +28,7 @@ const GitVersion.BuildAgents.SpaceAutomation.EnvironmentVariableName = "JB_SPACE const GitVersion.BuildAgents.TeamCity.EnvironmentVariableName = "TEAMCITY_VERSION" -> string! const GitVersion.BuildAgents.TravisCi.EnvironmentVariableName = "TRAVIS" -> string! const GitVersion.Configuration.ConfigurationFileLocator.DefaultFileName = "GitVersion.yml" -> string! -const GitVersion.Configuration.GitVersionConfiguration.DefaultTagPrefix = "[vV]" -> string! +const GitVersion.Configuration.GitVersionConfiguration.DefaultTagPrefix = "[vV]?" -> string! const GitVersion.Configuration.GitVersionConfiguration.DevelopBranchKey = "develop" -> string! const GitVersion.Configuration.GitVersionConfiguration.DevelopBranchRegex = "^dev(elop)?(ment)?$" -> string! const GitVersion.Configuration.GitVersionConfiguration.FeatureBranchKey = "feature" -> string! diff --git a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs index 7918fe5e6d..3394a66e44 100644 --- a/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs +++ b/src/GitVersion.Core/VersionCalculation/SemanticVersioning/SemanticVersion.cs @@ -143,7 +143,7 @@ public static SemanticVersion Parse(string version, string? tagPrefixRegex, Sema public static bool TryParse(string version, string? tagPrefixRegex, [NotNullWhen(true)] out SemanticVersion? semanticVersion, SemanticVersionFormat format = SemanticVersionFormat.Strict) { - var match = Regex.Match(version, $"^({tagPrefixRegex})?(?.*)$"); + var match = Regex.Match(version, $"^({tagPrefixRegex})(?.*)$"); if (!match.Success) { diff --git a/src/GitVersion.Core/VersionConverters/AssemblyInfo/ProjectFileUpdater.cs b/src/GitVersion.Core/VersionConverters/AssemblyInfo/ProjectFileUpdater.cs index 3eb04017cd..73c69b7b93 100644 --- a/src/GitVersion.Core/VersionConverters/AssemblyInfo/ProjectFileUpdater.cs +++ b/src/GitVersion.Core/VersionConverters/AssemblyInfo/ProjectFileUpdater.cs @@ -47,7 +47,15 @@ public void Execute(VersionVariables variables, AssemblyInfoContext context) var localProjectFile = projectFile.FullName; var originalFileContents = this.fileSystem.ReadAllText(localProjectFile); - var fileXml = XElement.Parse(originalFileContents); + XElement fileXml; + try + { + fileXml = XElement.Parse(originalFileContents); + } + catch (XmlException e) + { + throw new XmlException($"Unable to parse file as xml: {localProjectFile}", e); + } if (!CanUpdateProjectFile(fileXml)) {