diff --git a/dotnet-tools.json b/.config/dotnet-tools.json similarity index 89% rename from dotnet-tools.json rename to .config/dotnet-tools.json index 84ab2006ea..3ad6694334 100644 --- a/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "gitreleasemanager.tool": { - "version": "0.16.0", + "version": "0.20.0", "commands": [ "dotnet-gitreleasemanager" ] @@ -15,4 +15,4 @@ ] } } -} +} \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f6b9fc4559..df058170ac 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,8 +1,4 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/dotnet/.devcontainer/base.Dockerfile - -# [Choice] .NET version: 6.0, 5.0, 3.1, 6.0-bullseye, 5.0-bullseye, 3.1-bullseye, 6.0-focal, 5.0-focal, 3.1-focal -ARG VARIANT="6.0-bullseye-slim" -FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT} +FROM mcr.microsoft.com/devcontainers/dotnet:dev-9.0 # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b181bfaad1..69b116d50b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,42 +1,55 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.202.5/containers/dotnet { - "name": "C# (.NET)", - "runArgs": [ "--init" ], + "name": "GitVersion", "build": { "dockerfile": "Dockerfile", - "args": { - "VARIANT": "7.0", + "context": "." + }, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "username": "vscode", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + }, + "ghcr.io/devcontainers/features/git:1": { + "version": "os-provided", + "ppa": "false" + }, + "ghcr.io/devcontainers/features/powershell:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "latest" } }, - - // Set *default* container specific settings.json values on container create. - "settings": { - "editor.fontFamily": "'Cascadia Code', Consolas, 'Courier New', monospace", - "editor.rulers": [ 90 ], - "cSpell.words": [ - "commiting", - "gittools", - "gitversion" - ], + "customizations": { + "vscode": { + "settings": { + "editor.fontFamily": "'Cascadia Code', Consolas, 'Courier New', monospace", + "editor.rulers": [ 90 ], + "cSpell.words": [ + "commiting", + "gittools", + "gitversion" + ] + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-dotnettools.csdevkit", + "EditorConfig.EditorConfig", + "streetsidesoftware.code-spell-checker" + ] + } }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-dotnettools.csharp", - "EditorConfig.EditorConfig", - "streetsidesoftware.code-spell-checker" - ], - "postCreateCommand": "dotnet restore src; dotnet build build", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - "features": { - "docker-in-docker": "latest", - "git": "latest", - "github-cli": "latest", - "sshd": "latest", - "powershell": "latest" - } + "remoteUser": "vscode" } diff --git a/.editorconfig b/.editorconfig index cd66ed516f..f199d80f9e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,16 +1,21 @@ +root = true # http://editorconfig.org # top-most EditorConfig file -root = true [*] indent_style = space indent_size = 4 end_of_line = lf -charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +# Microsoft .NET properties +dotnet_style_qualification_for_event = false:none +dotnet_style_qualification_for_field = false:none +dotnet_style_qualification_for_method = false:none +dotnet_style_qualification_for_property = false:none + [*.yml] indent_size = 2 @@ -59,19 +64,12 @@ dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion dotnet_style_prefer_inferred_tuple_names = true:suggestion dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning dotnet_style_prefer_simplified_interpolation = true:suggestion - -# Dispose rules (CA2000 and CA2213) ported to IDE analyzers. We already execute the CA rules on the repo, so disable the IDE ones. -dotnet_diagnostic.IDE0005.severity = none -dotnet_diagnostic.IDE0067.severity = none -dotnet_diagnostic.IDE0068.severity = none -dotnet_diagnostic.IDE0069.severity = none -dotnet_diagnostic.CA1016.severity = none #### C# Coding Conventions #### # Prefer "var" everywhere -csharp_style_var_for_built_in_types = true:silent -csharp_style_var_when_type_is_apparent = true:silent -csharp_style_var_elsewhere = true:silent +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion # Prefer method-like constructs to have a block body, except for lambdas csharp_style_expression_bodied_methods = true:warning @@ -153,46 +151,29 @@ csharp_space_between_method_call_parameter_list_parentheses = false csharp_space_between_method_declaration_empty_parameter_list_parentheses = false csharp_space_between_method_declaration_name_and_open_parenthesis = false csharp_space_between_method_declaration_parameter_list_parentheses = false -csharp_space_between_parentheses = false csharp_space_between_square_brackets = false +resharper_csharp_use_roslyn_logic_for_evident_types = true + # Alignment -align_multiline_parameter = true +resharper_csharp_align_multiline_parameter = true # Qualify fields with "this." -csharp_instance_members_qualify_members = field - -# IDE0011: Add braces -dotnet_diagnostic.IDE0011.severity = none - -# IDE0090: Use 'new(...)' -dotnet_diagnostic.IDE0090.severity = warning - -# IDE0041: Use 'is null' check -dotnet_diagnostic.IDE0041.severity = warning - -# CA1825: Avoid zero-length array allocations -dotnet_diagnostic.CA1825.severity = warning - -# CA1822: Mark members as static -dotnet_diagnostic.CA1822.severity = warning - -# CA2208: Instantiate argument exceptions correctly -dotnet_diagnostic.CA2208.severity = warning - -# CA1810: Initialize reference type static fields inline -dotnet_diagnostic.CA1810.severity = warning - -# CA1816: Dispose methods should call SuppressFinalize -dotnet_diagnostic.CA1816.severity = warning +resharper_csharp_instance_members_qualify_members = field # IDE0005: Using directive is unnecessary. -dotnet_diagnostic.IDE0005.severity = warning +dotnet_diagnostic.ide0005.severity = warning # RCS1037: Remove trailing white-space. -dotnet_diagnostic.RCS1037.severity = error +dotnet_diagnostic.rcs1037.severity = error # RCS1036: Remove redundant empty line. -dotnet_diagnostic.RCS1036.severity = error +dotnet_diagnostic.rcs1036.severity = error + +xml_space_before_self_closing = true + +resharper_arrange_object_creation_when_type_not_evident_highlighting = none + +resharper_unused_auto_property_accessor_global_highlighting = none -[resharper_]xml_space_before_self_closing = true \ No newline at end of file +resharper_unused_method_return_value_global_highlighting = none diff --git a/.gitattributes b/.gitattributes index 9a5cb22250..14ce78d666 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,7 @@ # Custom for Visual Studio *.cs diff=csharp *.sln +*.slnx *.csproj *.vbproj *.fsproj diff --git a/.github/ISSUE_TEMPLATE/issue-report.yml b/.github/ISSUE_TEMPLATE/issue-report.yml index 373596a764..5e174295a5 100644 --- a/.github/ISSUE_TEMPLATE/issue-report.yml +++ b/.github/ISSUE_TEMPLATE/issue-report.yml @@ -20,6 +20,7 @@ body: - GitVersion.Portable - gittools/actions - AzureDevops task + - N/A multiple: true validations: required: true @@ -69,4 +70,4 @@ body: description: Log messages you receive when running. Make sure there is no sensitive data shared. No need for backticks here. render: shell validations: - required: false \ No newline at end of file + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 35967a1a21..4f351aa9c3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,30 +1,43 @@ ## Description + ## Related Issue + + + + ## Motivation and Context + ## How Has This Been Tested? + + + ## Screenshots (if appropriate): + + ## Checklist: + + -- [ ] My code follows the code style of this project. -- [ ] My change requires a change to the documentation. -- [ ] I have updated the documentation accordingly. -- [ ] I have added tests to cover my changes. -- [ ] All new and existing tests passed. +* \[ ] My code follows the code style of this project. +* \[ ] My change requires a change to the documentation. +* \[ ] I have updated the documentation accordingly. +* \[ ] I have added tests to cover my changes. +* \[ ] All new and existing tests passed. diff --git a/.github/actions/artifacts-attest/action.yml b/.github/actions/artifacts-attest/action.yml new file mode 100644 index 0000000000..7722489c36 --- /dev/null +++ b/.github/actions/artifacts-attest/action.yml @@ -0,0 +1,13 @@ +name: 'Artifacts attestation' +description: 'Artifacts attestation' + +runs: + using: 'composite' + steps: + - + name: 'Attestation' + uses: actions/attest-build-provenance@v2.0.1 + with: + subject-path: | + ${{ github.workspace }}/artifacts/packages/native + ${{ github.workspace }}/artifacts/packages/nuget \ No newline at end of file diff --git a/.github/actions/artifacts-restore/action.yml b/.github/actions/artifacts-restore/action.yml index 99be5e4897..acca453639 100644 --- a/.github/actions/artifacts-restore/action.yml +++ b/.github/actions/artifacts-restore/action.yml @@ -5,21 +5,26 @@ runs: using: 'composite' steps: - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v4 + uses: actions/download-artifact@v4 + name: Download native linux packages with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + name: native-Linux + path: ${{ github.workspace }}/artifacts/packages/native - - name: Use cached tools - id: cache-tools - uses: actions/cache@v4 + uses: actions/download-artifact@v4 + name: Download native windows packages with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} + name: native-Windows + path: ${{ github.workspace }}/artifacts/packages/native - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 + uses: actions/download-artifact@v4 + name: Download native macos packages with: - global-json-file: global.json + name: native-macOS + path: ${{ github.workspace }}/artifacts/packages/native + - + uses: actions/download-artifact@v4 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget \ No newline at end of file diff --git a/.github/actions/cache-restore/action.yml b/.github/actions/cache-restore/action.yml new file mode 100644 index 0000000000..3a3487843b --- /dev/null +++ b/.github/actions/cache-restore/action.yml @@ -0,0 +1,25 @@ +name: 'Cache restore' +description: 'Cache restore' + +runs: + using: 'composite' + steps: + - + name: Use cached cake frosting + id: cache-cake + uses: actions/cache@v4 + with: + path: run + key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + - + name: Use cached tools + id: cache-tools + uses: actions/cache@v4 + with: + path: tools + key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json \ No newline at end of file diff --git a/.github/actions/docker-manifests/action.yml b/.github/actions/docker-manifests/action.yml index 9c9a78ef9b..23de24c989 100644 --- a/.github/actions/docker-manifests/action.yml +++ b/.github/actions/docker-manifests/action.yml @@ -1,10 +1,10 @@ name: 'Docker Manifests' description: 'Docker Publish Manifests' inputs: - distro: + docker_distro: description: 'Linux Distro' required: true - targetFramework: + dotnet_version: description: '.net version' required: true docker_registry_username: @@ -32,7 +32,10 @@ runs: - name: '[Docker Publish Manifests] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerManifest --arch=amd64 --arch=arm64 --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry dockerhub + run: | + dotnet run/docker.dll ` + --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub - name: Login to GitHub uses: docker/login-action@v3 @@ -43,4 +46,7 @@ runs: - name: '[Docker Publish Manifests] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerManifest --arch=amd64 --arch=arm64 --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry github + run: | + dotnet run/docker.dll ` + --target=DockerManifest --arch=amd64 --arch=arm64 --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github diff --git a/.github/actions/docker-publish/action.yml b/.github/actions/docker-publish/action.yml index feff913274..e5f2e05757 100644 --- a/.github/actions/docker-publish/action.yml +++ b/.github/actions/docker-publish/action.yml @@ -4,10 +4,10 @@ inputs: arch: description: 'Docker architecture' required: true - distro: + docker_distro: description: 'Linux Distro' required: true - targetFramework: + dotnet_version: description: '.net version' required: true docker_registry_username: @@ -35,7 +35,10 @@ runs: - name: '[Docker Publish] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch=${{ inputs.arch }} --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry dockerhub --verbosity=diagnostic + run: | + dotnet run/docker.dll ` + --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub --verbosity=diagnostic - name: Login to GitHub uses: docker/login-action@v3 @@ -46,4 +49,7 @@ runs: - name: '[Docker Publish] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerPublish --arch=${{ inputs.arch }} --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry github --verbosity=diagnostic + run: | + dotnet run/docker.dll ` + --target=DockerPublish --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/actions/docker-setup/action.yml b/.github/actions/docker-setup/action.yml new file mode 100644 index 0000000000..7b75cebdfd --- /dev/null +++ b/.github/actions/docker-setup/action.yml @@ -0,0 +1,16 @@ +name: 'Docker Setup' +description: 'Setups the docker engine' + +runs: + using: 'composite' + steps: + - name: Set up Docker + uses: docker/setup-docker-action@v4 + with: + daemon-config: '{ "features": { "containerd-snapshotter": true } }' + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: 'latest' + driver-opts: 'image=moby/buildkit:buildx-stable-1' + install: true diff --git a/.github/actions/docker-test/action.yml b/.github/actions/docker-test/action.yml index 67b4afa070..c7a747121f 100644 --- a/.github/actions/docker-test/action.yml +++ b/.github/actions/docker-test/action.yml @@ -4,10 +4,10 @@ inputs: arch: description: 'Docker architecture' default: 'amd64' - distro: + docker_distro: description: 'Linux Distro' - default: 'debian.11' - targetFramework: + default: 'debian.12' + dotnet_version: description: '.net version' default: '8.0' @@ -17,8 +17,14 @@ runs: - name: '[Docker Build & Test] DockerHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerTest --arch=${{ inputs.arch }} --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry dockerhub --verbosity=diagnostic + run: | + dotnet run/docker.dll --target=DockerTest ` + --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry dockerhub --verbosity=diagnostic - name: '[Docker Build & Test] GitHub' shell: pwsh - run: dotnet run/docker.dll --target=DockerTest --arch=${{ inputs.arch }} --docker_dotnetversion=${{ inputs.targetFramework }} --docker_distro=${{ inputs.distro }} --docker_registry github --verbosity=diagnostic + run: | + dotnet run/docker.dll --target=DockerTest ` + --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` + --docker_distro=${{ inputs.docker_distro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 68699b5812..87b6a493c0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,87 +1,75 @@ version: 2 updates: -- package-ecosystem: nuget - labels: - - "dependencies" - commit-message: - prefix: "(ci deps)" - groups: - microsoft: - patterns: - - "Microsoft.*" - - "System.*" - directory: "/build" - schedule: - interval: daily - open-pull-requests-limit: 10 + - package-ecosystem: dotnet-sdk + labels: + - "dependencies" + commit-message: + prefix: "(sdk)" + directory: "/" + schedule: + interval: cron + cronjob: "0 12 * * *" + - package-ecosystem: nuget + labels: + - "dependencies" + commit-message: + prefix: "(deps)" + groups: + microsoft: + patterns: + - "Microsoft.*" + - "System.*" + Microsoft_CodeAnalysis: + patterns: + - "Microsoft.CodeAnalysis.*" + analyzers: + patterns: + - "*Analyzers" + serilog: + patterns: + - "Serilog.*" + nunit: + patterns: + - "NUnit.*" + LibGit2Sharp: + patterns: + - "LibGit2Sharp.*" + JsonSchemaNet: + patterns: + - "JsonSchemaNet.*" + directories: + - "/build" + - "/new-cli" + - "/src" + schedule: + interval: cron + cronjob: "0 12 * * *" + open-pull-requests-limit: 10 -- package-ecosystem: nuget - labels: - - "dependencies" - commit-message: - prefix: "(new-cli deps)" - groups: - microsoft: - patterns: - - "Microsoft.*" - - "System.*" - serilog: - patterns: - - "Serilog.*" - directory: "/new-cli" - schedule: - interval: daily - open-pull-requests-limit: 10 - -- package-ecosystem: nuget - labels: - - "dependencies" - commit-message: - prefix: "(deps)" - groups: - microsoft: - patterns: - - "Microsoft.*" - - "System.*" - analyzers: - patterns: - - "*Analyzers" - serilog: + - package-ecosystem: github-actions + labels: + - "dependencies" + commit-message: + prefix: "(build deps)" + groups: + actions: patterns: - - "Serilog.*" - nunit: - patterns: - - "NUnit.*" - directory: "/src" - schedule: - interval: daily - open-pull-requests-limit: 10 - ignore: - - dependency-name: "Microsoft.Build" - versions: ["16.9.0", "16.11.0"] + - "actions/*" + directory: "/" + schedule: + interval: cron + cronjob: "0 12 * * *" -- package-ecosystem: github-actions - labels: - - "dependencies" - commit-message: - prefix: "(build deps)" - groups: - actions: - patterns: - - "actions/*" - directory: "/" - schedule: - interval: daily - -- package-ecosystem: npm - labels: - - "dependencies" - commit-message: - prefix: "(docs deps)" - groups: - remark: - patterns: - - "remark*" - directory: "/" - schedule: - interval: monthly + - package-ecosystem: npm + labels: + - "dependencies" + commit-message: + prefix: "(docs deps)" + groups: + remark: + patterns: + - "remark*" + directory: "/" + schedule: + interval: cron + cronjob: "0 12 1,15 * *" diff --git a/.github/workflows/_artifacts_linux.yml b/.github/workflows/_artifacts_linux.yml index c59401db18..4bd3272370 100644 --- a/.github/workflows/_artifacts_linux.yml +++ b/.github/workflows/_artifacts_linux.yml @@ -7,6 +7,12 @@ on: arch: required: true type: string + docker_distros: + required: true + type: string + dotnet_versions: + required: true + type: string env: DOTNET_INSTALL_DIR: "./.dotnet" @@ -14,14 +20,13 @@ env: jobs: artifacts: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false matrix: - distro: [ alpine.3.17, alpine.3.18, centos.stream.8, debian.11, fedora.37, ubuntu.20.04, ubuntu.22.04 ] - targetFramework: [ '6.0', '7.0', '8.0' ] - + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - name: Checkout @@ -30,7 +35,7 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - uses: actions/download-artifact@v4 name: Download nuget packages @@ -41,9 +46,15 @@ jobs: uses: actions/download-artifact@v4 name: Download native packages with: - name: native-${{ runner.os }} + name: native-Linux path: ${{ github.workspace }}/artifacts/packages/native + - + name: Set up Docker + uses: ./.github/actions/docker-setup - name: '[Test Artifacts]' shell: pwsh - run: dotnet run/artifacts.dll --target=ArtifactsTest --arch=${{ inputs.arch }} --docker_dotnetversion=${{ matrix.targetFramework }} --docker_distro=${{ matrix.distro }} \ No newline at end of file + run: | + dotnet run/artifacts.dll ` + --target=ArtifactsTest --arch=${{ inputs.arch }} --dotnet_version=${{ matrix.dotnet_version }} ` + --docker_distro=${{ matrix.docker_distro }} \ No newline at end of file diff --git a/.github/workflows/_artifacts_windows.yml b/.github/workflows/_artifacts_windows.yml index 0f569701a5..c93e7092bd 100644 --- a/.github/workflows/_artifacts_windows.yml +++ b/.github/workflows/_artifacts_windows.yml @@ -8,7 +8,7 @@ env: jobs: artifacts: name: ${{ matrix.package }} - runs-on: windows-latest + runs-on: windows-2025 strategy: fail-fast: false matrix: @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - uses: actions/download-artifact@v4 name: Download nuget packages diff --git a/.github/workflows/_build.yml b/.github/workflows/_build.yml index f3cfe1411a..b3ce787c63 100644 --- a/.github/workflows/_build.yml +++ b/.github/workflows/_build.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest, macos-13, macos-14] + os: [windows-2025, ubuntu-24.04, macos-15] runs-on: ${{ matrix.os }} steps: @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - name: '[Build]' shell: pwsh @@ -30,21 +30,21 @@ jobs: - name: 'Upload nuget packages' uses: actions/upload-artifact@v4 - if: matrix.os == 'windows-latest' + if: matrix.os == 'windows-2025' with: name: nuget path: ${{ github.workspace }}/artifacts/packages/nuget - name: 'Upload native packages' uses: actions/upload-artifact@v4 - if: matrix.os == 'windows-latest' + if: matrix.os == 'windows-2025' with: name: native-${{ runner.os }} path: ${{ github.workspace }}/artifacts/packages/native/*.zip - name: 'Upload native packages' uses: actions/upload-artifact@v4 - if: matrix.os != 'windows-latest' && matrix.os != 'macos-13' + if: matrix.os != 'windows-2025' with: name: native-${{ runner.os }} path: ${{ github.workspace }}/artifacts/packages/native/*.tar.gz diff --git a/.github/workflows/_docker.yml b/.github/workflows/_docker.yml index 2178675f9b..8d3d3129cc 100644 --- a/.github/workflows/_docker.yml +++ b/.github/workflows/_docker.yml @@ -7,6 +7,12 @@ on: arch: required: true type: string + docker_distros: + required: true + type: string + dotnet_versions: + required: true + type: string env: DOTNET_INSTALL_DIR: "./.dotnet" @@ -14,14 +20,13 @@ env: jobs: docker: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false matrix: - distro: [ alpine.3.17, alpine.3.18, centos.stream.8, debian.11, fedora.37, ubuntu.20.04, ubuntu.22.04 ] - targetFramework: [ '6.0', '7.0', '8.0' ] - + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - name: Checkout @@ -30,7 +35,7 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - uses: actions/download-artifact@v4 name: Download nuget packages @@ -39,45 +44,24 @@ jobs: path: ${{ github.workspace }}/artifacts/packages/nuget - name: Set up Docker - uses: crazy-max/ghaction-setup-docker@v3 - with: - daemon-config: '{ "features": { "containerd-snapshotter": true } }' - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: 'latest' - driver-opts: 'image=moby/buildkit:buildx-stable-1' - install: true + uses: ./.github/actions/docker-setup - name: Docker Test if: success() && github.event_name == 'pull_request' || github.repository_owner != 'GitTools' uses: ./.github/actions/docker-test with: arch: ${{ inputs.arch }} - distro: ${{ matrix.distro }} - targetFramework: ${{ matrix.targetFramework }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} - name: Docker Publish if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main' uses: ./.github/actions/docker-publish with: arch: ${{ inputs.arch }} - distro: ${{ matrix.distro }} - targetFramework: ${{ matrix.targetFramework }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} docker_registry_username: ${{ secrets.DOCKER_USERNAME }} docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} github_registry_username: ${{ github.repository_owner }} - github_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }} - - - name: DockerHub Publish Readme - if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main' - shell: pwsh - run: dotnet run/docker.dll --target=DockerHubReadmePublish - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - + github_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/_docker_manifests.yml b/.github/workflows/_docker_manifests.yml index 130bfc1793..07df99a950 100644 --- a/.github/workflows/_docker_manifests.yml +++ b/.github/workflows/_docker_manifests.yml @@ -1,5 +1,12 @@ on: workflow_call: + inputs: + docker_distros: + required: true + type: string + dotnet_versions: + required: true + type: string env: DOTNET_INSTALL_DIR: "./.dotnet" @@ -7,14 +14,13 @@ env: jobs: manifest: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} - runs-on: ubuntu-latest + name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }} + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: - distro: [ alpine.3.17, alpine.3.18, centos.stream.8, debian.11, fedora.37, ubuntu.20.04, ubuntu.22.04 ] - targetFramework: [ '6.0', '7.0', '8.0' ] - + docker_distro: ${{ fromJson(inputs.docker_distros) }} + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - name: Checkout @@ -23,29 +29,17 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - name: Set up Docker - uses: crazy-max/ghaction-setup-docker@v3 - with: - daemon-config: '{ "features": { "containerd-snapshotter": true } }' - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: 'latest' - driver-opts: 'image=moby/buildkit:buildx-stable-1' - install: true + uses: ./.github/actions/docker-setup - name: Docker Manifests if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main' uses: ./.github/actions/docker-manifests with: - distro: ${{ matrix.distro }} - targetFramework: ${{ matrix.targetFramework }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} docker_registry_username: ${{ secrets.DOCKER_USERNAME }} docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} github_registry_username: ${{ github.repository_owner }} diff --git a/.github/workflows/_prepare.yml b/.github/workflows/_prepare.yml index 9f70c547f7..0fd502d823 100644 --- a/.github/workflows/_prepare.yml +++ b/.github/workflows/_prepare.yml @@ -1,5 +1,16 @@ on: workflow_call: + outputs: + docker_distros: + description: 'List of Docker distros' + value: ${{ jobs.set_matrix.outputs.docker_distros }} + dotnet_versions: + description: 'List of .NET versions' + value: ${{ jobs.set_matrix.outputs.dotnet_versions }} + +env: + DOTNET_INSTALL_DIR: "./.dotnet" + DOTNET_ROLL_FORWARD: "Major" jobs: prepare: @@ -7,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest, macos-13, macos-14] + os: [windows-2025, ubuntu-24.04, macos-15] runs-on: ${{ matrix.os }} steps: @@ -35,8 +46,27 @@ jobs: - name: '[Build]' if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/CI.sln --configuration=Release + run: dotnet build build/ --configuration=Release - name: '[Prepare]' shell: pwsh run: dotnet run/build.dll --target=BuildPrepare + set_matrix: + needs: [ prepare ] + name: Set Matrix + runs-on: ubuntu-24.04 + outputs: + docker_distros: ${{ steps.set_matrix.outputs.docker_distros }} + dotnet_versions: ${{ steps.set_matrix.outputs.dotnet_versions }} + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Restore State + uses: ./.github/actions/cache-restore + - + name: '[Matrix]' + id: set_matrix + shell: pwsh + run: dotnet run/config.dll --target=SetMatrix \ No newline at end of file diff --git a/.github/workflows/_publish.yml b/.github/workflows/_publish.yml index ce6157faef..142042a8da 100644 --- a/.github/workflows/_publish.yml +++ b/.github/workflows/_publish.yml @@ -8,7 +8,7 @@ env: jobs: publish: name: ${{ matrix.taskName }} - runs-on: windows-latest + runs-on: windows-2025 strategy: fail-fast: false matrix: @@ -26,7 +26,7 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - uses: actions/download-artifact@v4 name: Download nuget packages @@ -36,4 +36,4 @@ jobs: - name: '[Publish]' shell: pwsh - run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }} + run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }} \ No newline at end of file diff --git a/.github/workflows/_unit_tests.yml b/.github/workflows/_unit_tests.yml index dadb5300c2..c3a45146dd 100644 --- a/.github/workflows/_unit_tests.yml +++ b/.github/workflows/_unit_tests.yml @@ -1,20 +1,23 @@ on: workflow_call: - + inputs: + dotnet_versions: + required: true + type: string env: DOTNET_INSTALL_DIR: "./.dotnet" DOTNET_ROLL_FORWARD: "Major" - + jobs: unit_test: - name: ${{ matrix.os }} - ${{ matrix.targetFramework }} + name: ${{ matrix.os }} - net${{ matrix.dotnet_version }} env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest, macos-13, macos-14] - targetFramework: [ 'net8.0', 'net7.0', 'net6.0' ] + os: [windows-2025, ubuntu-24.04, macos-15] + dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} runs-on: ${{ matrix.os }} steps: @@ -25,15 +28,15 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - name: '[Unit Test]' shell: pwsh - run: dotnet run/build.dll --target=Test --dotnet_target=${{ matrix.targetFramework }} + run: dotnet run/build.dll --target=Test --dotnet_version=${{ matrix.dotnet_version }} - name: Test Summary - uses: test-summary/action@v2.3 - if: matrix.targetFramework == 'net8.0' + uses: test-summary/action@v2.4 + if: ${{ always() && matrix.dotnet_version == '9.0' }} with: paths: artifacts/test-results/*.results.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b5b447e00..4e26468265 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,9 @@ on: paths: - '**' - '!docs/**' - + merge_group: + types: [checks_requested] + repository_dispatch: types: [ ci-release ] @@ -32,14 +34,16 @@ env: ENABLED_DIAGNOSTICS: ${{ secrets.ENABLED_DIAGNOSTICS }} permissions: + id-token: write contents: read packages: write + attestations: write jobs: prepare: name: Prepare uses: ./.github/workflows/_prepare.yml - + build: name: Build & Package needs: [ prepare ] @@ -49,6 +53,8 @@ jobs: name: Test needs: [ prepare ] uses: ./.github/workflows/_unit_tests.yml + with: + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} secrets: inherit artifacts_windows_test: @@ -57,43 +63,50 @@ jobs: uses: ./.github/workflows/_artifacts_windows.yml artifacts_linux_test: - needs: [ build ] + needs: [ prepare, build ] name: Artifacts Linux (${{ matrix.arch }}) strategy: fail-fast: false matrix: include: - arch: amd64 - runner: ubuntu-latest + runner: ubuntu-24.04 - arch: arm64 - runner: ubuntu-latest + runner: ubuntu-24.04-arm uses: ./.github/workflows/_artifacts_linux.yml with: runner: ${{ matrix.runner }} arch: ${{ matrix.arch }} + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} docker_linux_images: - needs: [ build ] + needs: [ prepare, build ] name: Docker Images (${{ matrix.arch }}) strategy: fail-fast: false matrix: include: - arch: amd64 - runner: ubuntu-latest + runner: ubuntu-24.04 - arch: arm64 - runner: ubuntu-latest + runner: ubuntu-24.04-arm uses: ./.github/workflows/_docker.yml with: runner: ${{ matrix.runner }} arch: ${{ matrix.arch }} + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} secrets: inherit docker_linux_manifests: - needs: [ docker_linux_images ] + needs: [ prepare, docker_linux_images ] name: Docker Manifests uses: ./.github/workflows/_docker_manifests.yml + with: + docker_distros: ${{ needs.prepare.outputs.docker_distros }} + dotnet_versions: ${{ needs.prepare.outputs.dotnet_versions }} secrets: inherit publish: @@ -105,7 +118,7 @@ jobs: release: name: Release needs: [ publish, docker_linux_manifests ] - runs-on: windows-latest + runs-on: windows-2025 env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} steps: @@ -116,25 +129,22 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - - uses: actions/download-artifact@v4 - name: Download native linux packages - with: - name: native-Linux - path: ${{ github.workspace }}/artifacts/packages/native + name: Restore Artifacts + uses: ./.github/actions/artifacts-restore - - uses: actions/download-artifact@v4 - name: Download native windows packages - with: - name: native-Windows - path: ${{ github.workspace }}/artifacts/packages/native + name: Attetstation + if: ${{ github.event_name == 'repository_dispatch' }} + uses: ./.github/actions/artifacts-attest - - uses: actions/download-artifact@v4 - name: Download native macos packages - with: - name: native-macOS - path: ${{ github.workspace }}/artifacts/packages/native + name: DockerHub Publish Readme + if: ${{ github.event_name == 'repository_dispatch' }} + shell: pwsh + run: dotnet run/docker.dll --target=DockerHubReadmePublish + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - name: '[Release]' shell: pwsh diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0597068156..67c9758109 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: contents: read # for actions/checkout to fetch code security-events: write # for github/codeql-action/analyze to upload SARIF results name: Analyze - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -71,11 +71,10 @@ jobs: uses: actions/setup-dotnet@v4 with: global-json-file: global.json - - name: '[Prepare]' if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/CI.sln --configuration=Release + run: dotnet build build/ --configuration=Release - name: '[Build]' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3aea86e6e8..a08e5717da 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -33,11 +33,7 @@ env: jobs: prepare: name: Prepare Build - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [windows-latest, ubuntu-latest] + runs-on: ubuntu-24.04 steps: - @@ -82,7 +78,7 @@ jobs: - name: '[Build]' if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/CI.sln --configuration=Release + run: dotnet build build/ --configuration=Release - name: '[Prepare]' shell: pwsh @@ -91,7 +87,7 @@ jobs: validate: name: Validates Html needs: [ prepare ] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout @@ -100,7 +96,7 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - name: '[Build Documentation]' shell: pwsh @@ -110,7 +106,7 @@ jobs: uses: chabad360/htmlproofer@master with: directory: ./artifacts/docs/preview - arguments: --ignore-urls /api/,/docs/ --allow-hash-href --assume-extension --disable-external --no-check_external_hash + arguments: --ignore-urls /api/,/docs/,/5.12.0/ --allow-hash-href --allow-missing-href --assume-extension --disable-external --no-check_external_hash - name: '[Reviewdog Reporter]' id: reporter @@ -127,7 +123,7 @@ jobs: publish: name: Publish docs needs: [ validate ] - runs-on: windows-latest + runs-on: ubuntu-24.04 env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} GITHUB_USERNAME: ${{ github.actor }} @@ -139,12 +135,11 @@ jobs: fetch-depth: 0 - name: Restore State - uses: ./.github/actions/artifacts-restore + uses: ./.github/actions/cache-restore - name: '[Build Schemas]' shell: pwsh - run: | - dotnet run/docs.dll --target=GenerateSchemas + run: dotnet run/docs.dll --target=GenerateSchemas - name: '[Publish Documentation]' if: ${{ github.event_name == 'repository_dispatch' }} diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d67bface50..f05e80535c 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -34,10 +34,12 @@ env: jobs: format: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 name: DotNet Format steps: - - uses: actions/checkout@v4 + - + name: Checkout + uses: actions/checkout@v4 - name: Setup .NET SDK uses: actions/setup-dotnet@v4 @@ -46,12 +48,6 @@ jobs: - name: Run Format 'ci' solution run: dotnet format ./build/ --verify-no-changes - - - name: Build 'new-cli' solution - run: dotnet build ./new-cli - - - name: Run Format 'new-cli' solution - run: dotnet format ./new-cli/ --exclude ~/.nuget/packages --verify-no-changes - name: Run Format 'GitVersion' solution run: dotnet format ./src/ --exclude **/AddFormats/ --verify-no-changes diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml new file mode 100644 index 0000000000..e3918452ad --- /dev/null +++ b/.github/workflows/mkdocs.yml @@ -0,0 +1,47 @@ +name: Markdown Update +on: + push: + +env: + DOTNET_ROLL_FORWARD: "Major" + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 + +defaults: + run: + shell: pwsh + +jobs: + docs: + name: Update Markdown (embedded snippets) + runs-on: ubuntu-24.04 + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + - + name: Run MarkdownSnippets + run: | + dotnet tool install --global MarkdownSnippets.Tool + mdsnippets --write-header false + working-directory: ${{ github.workspace }}/docs/input + - + name: Check for changes + id: status + run: | + if ($null -ne (git status --porcelain)) { echo "has_changes=1"; echo "has_changes=1" >> $env:GITHUB_OUTPUT } + - + name: Push changes + run: | + git add --verbose . + git config user.name 'Artur Stolear' + git config user.email 'artur.stolear@gmail.com' + git commit -m 'Docs changes' --allow-empty + git push --force + if: steps.status.outputs.has_changes == '1' \ No newline at end of file diff --git a/.github/workflows/new-cli.yml b/.github/workflows/new-cli.yml new file mode 100644 index 0000000000..aa466cc455 --- /dev/null +++ b/.github/workflows/new-cli.yml @@ -0,0 +1,56 @@ +name: Build (new-cli) +on: + push: + branches: + - main + - 'fix/*' + - 'feature/*' + - 'poc/*' + - 'support/*' + paths: + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/new-cli.yml + + pull_request: + branches: + - main + - 'support/*' + paths: + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/new-cli.yml + +permissions: + contents: read + +env: + DOTNET_ROLL_FORWARD: "Major" + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 + +jobs: + format: + runs-on: ubuntu-24.04 + name: Build & Test (new-cli) + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + - + name: Build 'new-cli' solution + run: dotnet build ./new-cli + - + name: Run Format 'new-cli' solution + run: dotnet format ./new-cli --exclude ~/.nuget/packages --verify-no-changes + - + name: Test 'new-cli' solution + run: dotnet test ./new-cli --no-build --verbosity normal diff --git a/.github/workflows/qodana_analysis.yml b/.github/workflows/qodana_analysis.yml new file mode 100644 index 0000000000..de9cd77019 --- /dev/null +++ b/.github/workflows/qodana_analysis.yml @@ -0,0 +1,35 @@ +name: Qodana +on: + workflow_dispatch: + push: + branches: + - main + - 'fix/*' + - 'feature/*' +jobs: + qodana: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write + steps: + - + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - + name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + - + name: 'Qodana Scan' + uses: jetbrains/qodana-action@v2025.1.1 + with: + args: --baseline,qodana.sarif.json + cache-default-branch-only: true + pr-mode: true + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21297ee23c..ae9230ea55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,17 +6,21 @@ on: jobs: release: name: Trigger ci flow - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 - - name: Get version + - + name: Checkout + uses: actions/checkout@v4 + - + name: Get version id: get-version shell: pwsh run: | # Finding the version from release tag $VERSION="${{ github.ref }}".Replace("refs/tags/", "") "version=$VERSION" >> $env:GITHUB_OUTPUT - - uses: peter-evans/repository-dispatch@v3 + - + uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.RELEASE_GITHUB_TOKEN }} repository: ${{ github.repository }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index b6b44be7cf..4db0930525 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -11,7 +11,7 @@ permissions: jobs: stale: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/stale@v9 with: diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 7fd925f7be..f6ad004ed9 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -17,7 +17,7 @@ jobs: permissions: contents: none name: Bump winget manifest - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Get version id: get-version @@ -29,12 +29,12 @@ jobs: } $url = "https://github.com/GitTools/GitVersion/releases/download/{0}/gitversion-win-{1}-{0}.zip" - $urls = @(($url -f $version, "x64"), ($url -f $version, "arm64")) -Join "," + $urls = @(($url -f $version, "x64"), ($url -f $version, "arm64")) -Join " " - $run_args = "update --id GitTools.GitVersion --version $version --urls $urls --token ${{ secrets.RELEASE_GITHUB_TOKEN }} --submit" + $run_args = "update GitTools.GitVersion --version $version --urls $urls --token ${{ secrets.RELEASE_GITHUB_TOKEN }} --submit" "version=$version" >> $env:GITHUB_OUTPUT "run_args=$run_args" >> $env:GITHUB_OUTPUT - - uses: michidk/run-komac@v2 + - uses: michidk/run-komac@v2.1.0 with: args: '${{ steps.get-version.outputs.run_args }}' \ No newline at end of file diff --git a/.gitignore b/.gitignore index eae9380097..dfc424aaaa 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ *.dotCover *.orig *~ +msbuild.binlog ## If you have NuGet Package Restore enabled, uncomment this packages/ @@ -60,7 +61,6 @@ TestResults ClientBin stylecop.* ~$* -*~ *.dbmdl site/ Generated_Code #added for RIA/Silverlight projects @@ -83,10 +83,8 @@ Thumbs.db Desktop.ini _NCrunch_GitVersion -GitVersion.sln.ide/ .vs/ Packages/ -site/ /TestResult.xml ################ @@ -94,8 +92,6 @@ site/ ################ .idea -*.sln.iml - #################### # Visual Studio Code @@ -135,3 +131,5 @@ node_modules dogfood/ new-cli/log.txt + +new-cli/logs/ diff --git a/.gitversion.yml b/.gitversion.yml new file mode 100644 index 0000000000..7c62fc859e --- /dev/null +++ b/.gitversion.yml @@ -0,0 +1,7 @@ +workflow: GitFlow/v1 +mode: ManualDeployment +branches: + main: + label: rc + support: + label: beta diff --git a/.markdownlint.json b/.markdownlint.json index 7ab1720b67..08d535e1cb 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,3 +1,4 @@ { - "MD026": false + "MD026": false, + "MD041": false } diff --git a/.remarkrc.yaml b/.remarkrc.yaml index cf4ada6d5f..381dd0220c 100644 --- a/.remarkrc.yaml +++ b/.remarkrc.yaml @@ -21,7 +21,6 @@ plugins: - remark-lint-list-item-bullet-indent - remark-lint-list-item-content-indent - remark-lint-maximum-heading-length: 120 - - remark-lint-no-auto-link-without-protocol - remark-lint-no-blockquote-without-marker - remark-lint-no-consecutive-blank-lines - remark-lint-no-duplicate-definitions @@ -36,7 +35,6 @@ plugins: - remark-lint-no-heading-content-indent - remark-lint-no-heading-indent - remark-lint-no-heading-like-paragraph - - remark-lint-no-inline-padding - remark-lint-no-literal-urls - remark-lint-no-multiple-toplevel-headings - remark-lint-no-reference-like-url diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index 27863697a4..e1ab2c4975 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,67 +1,129 @@ -## Unreleased +## v6.2.0 + +* The configuration property `label-number-pattern` was removed. The functionality can be still used by changing the label and the branch name regular expression for pull-request branches. + +## v6.0.0 + ### Platforms -* Drop support for .NET Framework 4.8, .NET Core 3.1 and .NET 5.0. Changed the project targets to .NET 6.0 or later. + +* Drop support for .NET Framework 4.8, .NET Core 3.1 and .NET 5.0. Changed the project targets to .NET 6.0 or later. ### Caching -* Refactor caching system in GitVersion to use json files instead of yaml files. This change is not backwards compatible with the old caching system. + +* Refactor caching system in GitVersion to use json files instead of yaml files. This change is not backwards compatible with the old caching system. ### Configuration changes: -* The configuration properties `continuous-delivery-fallback-tag`, `tag-number-pattern`, and `tag` were renamed to `continuous-delivery-fallback-label`, `label-number-pattern`, and `label` respectively. `tag-pre-release-weight` and `tag-prefix` remained as they were as they are referring to a Git tag. -* When using a commit message that matches **both** `*-version-bump-message` and `no-bump-message`, there is no increment for that commit. In other words, `no-bump-message` now takes precedence over `*-version-bump-message`. -* The fallback version strategy now returns `0.0.0` and is flagged with `ShouldIncrement` equal to `true`. This yields the version `0.1.0` on the `develop` branch (`IncrementStrategy.Minor` by default) and `0.0.1` on the `main` branch (`IncremetnStrategy.Patch` by default). -* The current branch (child) inherits its configuration from the source (parent) branch if the `increment` strategy is set to `Inherit`. This makes branch configuration recursive, simpler, more intuitive, more flexible, and more robust. -* Instead of having a single effective configuration, we now have one effective configuration per branch where the increment strategy is not set to `inherit`. -* The new implementation of the branch configuration inheritance affects per default only the pull-requests, hotfix and feature branches. In this case the next version will be generated like the child branch is not existing and the commits have been made on the source branch. - * The following example illustrates this behavior. On the feature branch the semantic version `1.1.0-just-a-test.1+2` will now be generated instead of version `1.0.0-just-a-test.1+3` previously: - ``` + +* The configuration properties `continuous-delivery-fallback-tag`, `tag-number-pattern`, and `tag` were renamed to `continuous-delivery-fallback-label`, `label-number-pattern`, and `label` respectively. `tag-pre-release-weight` and `tag-prefix` remained as they were as they are referring to a Git tag. + +* When using a commit message that matches **both** `*-version-bump-message` and `no-bump-message`, there is no increment for that commit. In other words, `no-bump-message` now takes precedence over `*-version-bump-message`. + +* The fallback version strategy now returns `0.0.0` and is flagged with `ShouldIncrement` equal to `true`. This yields the version `0.1.0` on the `develop` branch (`IncrementStrategy.Minor` by default) and `0.0.1` on the `main` branch (`IncremetnStrategy.Patch` by default). + +* The current branch (child) inherits its configuration from the source (parent) branch if the `increment` strategy is set to `Inherit`. This makes branch configuration recursive, simpler, more intuitive, more flexible, and more robust. + +* Instead of having a single effective configuration, we now have one effective configuration per branch where the increment strategy is not set to `inherit`. + +* The new implementation of the branch configuration inheritance affects per default only the pull-requests, hotfix and feature branches. In this case the next version will be generated like the child branch is not existing and the commits have been made on the source branch. + * The following example illustrates this behavior. On the feature branch the semantic version `1.1.0-just-a-test.1+2` will now be generated instead of version `1.0.0-just-a-test.1+3` previously: + + ```log * 1f1cfb4 52 minutes ago (HEAD -> feature/just-a-test) * 1f9654d 54 minutes ago (release/1.1.0) * be72411 56 minutes ago (develop) * 14800ff 58 minutes ago (tag: 1.0.0, main) ``` -* A new `unknown` branch magic string has been introduced to give the user the possibility to specify the branch configuration for a branch which is not known. A branch is not known if only the regular expression of the branch configuration with the name `unknown` is matching. Please notice that this branch configuration behaves like any other branch configurations. -* Additional `fallback` branch configuration properties have been introduced at the root to define base properties which will be inherit to the branch configurations. That means if no other branch configuration in the inheritance line defines the given property the fallback property applies. Notice that the inheritance tree can be controlled using the increment strategy property in the branch configuration section. - * The following example illustrates this behavior. The hotfix branch configuration overrides the main branch configuration and the result overrides the fallback branch configuration. - ``` + +* A new `unknown` branch magic string has been introduced to give the user the possibility to specify the branch configuration for a branch which is not known. A branch is not known if only the regular expression of the branch configuration with the name `unknown` is matching. Please notice that this branch configuration behaves like any other branch configurations. + +* Additional `fallback` branch configuration properties have been introduced at the root to define base properties which will be inherit to the branch configurations. That means if no other branch configuration in the inheritance line defines the given property the fallback property applies. Notice that the inheritance tree can be controlled using the increment strategy property in the branch configuration section. + * The following example illustrates this behavior. The hotfix branch configuration overrides the main branch configuration and the result overrides the fallback branch configuration. + + ```log * 1f1cfb4 52 minutes ago (HEAD -> hotfix/just-a-test) * 14800ff 58 minutes ago (tag: 1.0.0, main) ``` -* When overriding the configuration with e.g. GitVersion.yaml the software distinguishes between properties who are not existent and properties who are `null`. This is especially important if the user wants to define branch related configuration which are marked with `increment` strategy `Inherit`. -* Following root configuration properties have been removed: - * continuous-delivery-fallback-tag -* A new branch related property with name `track-merge-message` has been introduced. Consider we have a `main` branch and a `release/1.0.0` branch and merge changes from `release/1.0.0` to the main branch. In this scenario the merge message will be interpreted as a next version `1.0.0` when `track-merge-message` is set to `true` otherwise `0.0.1`. -* The pre-release tags are only considered when they are matching with the label name of the branch. This has an effect on the way how the `CommitCountSource` will be determined. -* The process of increasing the version with bump message when `CommitMessageIncrementing` is enabled and increment strategy is `None` has been changed. -* A new configuration property with name `version-in-branch-pattern` has been introduced. This setting only applies on branches where the option `is-release-branch` is set to `true`. Please notice that the branch name needs to be defined after the version number by default (instead of `support/lts-2.0.0` please name the branch like `support/2.0.0-lts`). -* The `is-release-branch` property of the `hotfix` branch setting has been changed from `false` to `true`. If present the hotfix number will be considered now by default. -* In the GitHub and the Git Flow workflows the `label` property is by default set to an empty string on the `main` branch. This yields to a pre-release version on `main` with an empty tag. Instead of for instance `1.0.1+46` GitVersion generates the full semantic version `1.0.1-46` instead. This behavior can be changed to generate only stable versions (no pre-release version) with setting the label to `null` (Please keep in mind that the `label` property on root needs to be set to `null` as well, otherwise the fallback applies). This change is caused by issue #2347. -* The `useBranchName` magic string has been removed. Instead use `{BranchName}` for `label`. -* The `BranchPrefixToTrim` configuration property has been removed. `RegularExpression` is now used to capture named groups instead. - * Default `RegularExpression` for feature branches is changed from `^features?[/-]` to `^features?[/-](?.+)` to support using `{BranchName}` out-of-the-box - * Default `RegularExpression` for unknown branches is changed from `.*` to `(?.+)` to support using `{BranchName}` out-of-the-box -* The `Mainline` mode and the related implementation has been removed completely. The new `TrunkBased` version strategy should be used instead. -* The `TrunkBased` workflow doesn't support downgrading the increment for calculating the next version. This is the case if e.g. a bump messages has been defined which is lower than the branch increment. -* The branch related property `is-mainline` in the configuration system has been renamed to `is-main-branch` -* The versioning mode has been renamed to deployment mode and consists of following values: - * ManualDeployment (previously ContinuousDelivery) - * ContinuousDelivery (previously ContinuousDeployment) - * ContinuousDeployment (new) -* At the configuration root level, a new array called `strategies` has been introduced, which can consist of on or more following values: - * ConfiguredNextVersion - * MergeMessage - * TaggedCommit - * TrackReleaseBranches - * VersionInBranchName - * TrunkBased -* The initialization wizard has been removed. -* On the `develop`, `release` and `hotfix` branch the introduced branch related property `prevent-increment.when-current-commit-tagged` has been set to `false` to get the incremented instead of the tagged semantic version. + +* When overriding the configuration with e.g. GitVersion.yaml the software distinguishes between properties who are not existent and properties who are `null`. This is especially important if the user wants to define branch related configuration which are marked with `increment` strategy `Inherit`. + +* Following root configuration properties have been removed: + * continuous-delivery-fallback-tag + +* A new branch related property with name `track-merge-message` has been introduced. Consider we have a `main` branch and a `release/1.0.0` branch and merge changes from `release/1.0.0` to the main branch. In this scenario the merge message will be interpreted as a next version `1.0.0` when `track-merge-message` is set to `true` otherwise `0.0.1`. + +* The pre-release tags are only considered when they are matching with the label name of the branch. This has an effect on the way how the `CommitCountSource` will be determined. + +* The process of increasing the version with bump message when `CommitMessageIncrementing` is enabled and increment strategy is `None` has been changed. + +* A new configuration property with name `version-in-branch-pattern` has been introduced. This setting only applies on branches where the option `is-release-branch` is set to `true`. Please notice that the branch name needs to be defined after the version number by default (instead of `support/lts-2.0.0` please name the branch like `support/2.0.0-lts`). + +* The `is-release-branch` property of the `hotfix` branch setting has been changed from `false` to `true`. If present the hotfix number will be considered now by default. + +* In the GitHub and the Git Flow workflows the `label` property is by default set to an empty string on the `main` branch. This yields to a pre-release version on `main` with an empty tag. Instead of for instance `1.0.1+46` GitVersion generates the full semantic version `1.0.1-46` instead. This behavior can be changed to generate only stable versions (no pre-release version) with setting the label to `null` (Please keep in mind that the `label` property on root needs to be set to `null` as well, otherwise the fallback applies). This change is caused by issue #2347. + +* The `useBranchName` magic string has been removed. Instead use `{BranchName}` for `label`. + +* The `BranchPrefixToTrim` configuration property has been removed. `RegularExpression` is now used to capture named groups instead. + * Default `RegularExpression` for feature branches is changed from `^features?[\/-]` to `^features?[\/-](?.+)` to support using `{BranchName}` out-of-the-box + * Default `RegularExpression` for unknown branches is changed from `.*` to `(?.+)` to support using `{BranchName}` out-of-the-box + +* The `Mainline` mode and the related implementation has been removed completely. The new `Mainline` version strategy should be used instead. + +* The `Mainline` version strategy doesn't support downgrading the increment for calculating the next version. This is the case if e.g. a bump messages has been defined which is lower than the branch increment. + +* The branch related property `is-mainline` in the configuration system has been renamed to `is-main-branch` + +* The versioning mode has been renamed to deployment mode and consists of following values: + * ManualDeployment (previously ContinuousDelivery) + * ContinuousDelivery (previously ContinuousDeployment) + * ContinuousDeployment (new) + +* At the configuration root level, a new array called `strategies` has been introduced, which can consist of on or more following values: + * ConfiguredNextVersion + * MergeMessage + * TaggedCommit + * TrackReleaseBranches + * VersionInBranchName + * Mainline + +* The initialization wizard has been removed. + +* On the `develop`, `release` and `hotfix` branch the introduced branch related property `prevent-increment.when-current-commit-tagged` has been set to `false` to get the incremented instead of the tagged semantic version. + +* When setting the "ignore commits before" parameter to a future value, an exception will occur if no commits are found on the current branch. This behavior mimics that of an empty repository. + +* On the `GitFlow` workflow the increment property has been changed: + * in branch `release` from `None` to `Minor` and + * in branch `hotfix` from `None` to `Patch` + +* On the `GitHubFlow` workflow the increment property has been changed in branch `release` from `None` to `Patch`. + +* When creating a branch with name `hotfix/next` (by using the `GitFlow` workflow) or `release/next` (by the `GitHubFlow` workflow) the resulting version will yield to a patched version per default. + +* If you have a tag `1.0.0` on `main` and branch from `main` to `release/1.0.1` then the next version number will be `1.1.0` when using the `GitFlow` workflow. This behavior is expected (but different compared to the `GitHubFlow` workflow) because on the `GitFlow` workflow you have an addition branch configuration with name hotfix where `is-release-branch` is set to `true`. That means if you want `1.0.1` as a next version you need to branch to `hotfix/1.0.1` or `hotfix/next`. On the other hand if you use the `GitHubFlow` workflow the next version number will be `1.0.1` because the increment on the `release` branch is set to `Patch`. + +* There is a new configuration parameter `semantic-version-format` with default of `Strict`. The behavior of `Strict` is, that every possible non-semver version e.g. `1.2.3.4` is ignored when trying to calculate the next version. So, if you have three-part and four-part version numbers mixed, it will compute the next version on basis of the last found three-part version number, ignoring all four-part numbers. +This is different compared to v5 where per default it was a `Loose` comparison. + +### Legacy Output Variables + +The following legacy output variables have been removed in this version: + +* `BuildMetaDataPadded` +* `LegacySemVer` +* `LegacySemVerPadded` +* `NuGetVersionV2` +* `NuGetVersion` +* `NuGetPreReleaseTagV2` +* `NuGetPreReleaseTag` +* `CommitsSinceVersionSourcePadded` ## v5.0.0 -* Version numbers in branches other than `release` branches are no longer - considered as a version source by default. Implemented in [#1541][pr-1541]. -* [#1581][pr-1581] folds `GitTools.Core` back into GitVersion to make - maintaining GitVersion easier. +* Version numbers in branches other than `release` branches are no longer + considered as a version source by default. Implemented in [#1541][pr-1541]. +* [#1581][pr-1581] folds `GitTools.Core` back into GitVersion to make + maintaining GitVersion easier. ## v4.0.0 @@ -70,36 +132,38 @@ When using GitFlow, a few things have changed. Hopefully the new settings just work for you -* `develop` has pre-release tag of `alpha` now, not unstable. -* `develop` will bump as soon as a `release` branch is created. -* Look at the [GitFlow examples][gitflow] for details of how it works now. +* `develop` has pre-release tag of `alpha` now, not unstable. +* `develop` will bump as soon as a `release` branch is created. +* Look at the [GitFlow examples][gitflow] for details of how it works now. ### Configuration Changes -* `GitVersionConfig.yaml` is deprecated in favor of `GitVersion.yml`. -* Regular expressions are no longer used as keys in branch config - * We have named branches, and introduced a `regex` config which you can - override. - * The default keys are: `master`, `develop`, `feature`, `release`, `pull-request`, - `hotfix` and `support` - * Just run `GitVersion.exe` in your project directory and it will tell you - what to change your config keys to - * For example, `dev(elop)?(ment)?$` is now just `develop`, we suggest not - overring regular expressions unless you really want to use a different convention. -* `source-branches` added as a configuration option for branches, it helps - GitVersion pick the correct source branch +* `GitVersionConfig.yaml` is deprecated in favor of `GitVersion.yml`. +* Regular expressions are no longer used as keys in branch config + * We have named branches, and introduced a `regex` config which you can + override. + * The default keys are: `master`, `develop`, `feature`, `release`, `pull-request`, + `hotfix` and `support` + * Just run `GitVersion.exe` in your project directory and it will tell you + what to change your config keys to + * For example, `dev(elop)?(ment)?$` is now just `develop`, we suggest not + overring regular expressions unless you really want to use a different convention. +* `source-branches` added as a configuration option for branches, it helps + GitVersion pick the correct source branch ## v3.0.0 -* NextVersion.txt has been deprecated, only `GitVersionConfig.yaml` is supported -* `AssemblyFileSemVer` variable removed, `AssemblyVersioningScheme` configuration - value makes this variable obsolete -* Variables `ClassicVersion` and `ClassicVersionWithTag` removed -* MSBuild task arguments (`AssemblyVersioningScheme`, `DevelopBranchTag`, - `ReleaseBranchTag`, `TagPrefix`, `NextVersion`) have been removed, use - `GitVersionConfig.yaml` instead -* GitVersionTask's `ReleaseDateAttribute` no longer exists +* NextVersion.txt has been deprecated, only `GitVersionConfig.yaml` is supported +* `AssemblyFileSemVer` variable removed, `AssemblyVersioningScheme` configuration + value makes this variable obsolete +* Variables `ClassicVersion` and `ClassicVersionWithTag` removed +* MSBuild task arguments (`AssemblyVersioningScheme`, `DevelopBranchTag`, + `ReleaseBranchTag`, `TagPrefix`, `NextVersion`) have been removed, use + `GitVersionConfig.yaml` instead +* GitVersionTask's `ReleaseDateAttribute` no longer exists [gitflow]: https://gitversion.net/docs/learn/branching-strategies/gitflow-examples_complete + [pr-1541]: https://github.com/GitTools/GitVersion/pull/1541 + [pr-1581]: https://github.com/GitTools/GitVersion/pull/1581 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index da08a4f88a..ac82b46b95 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,10 +2,10 @@ We love contributions to get started contributing you might need: -* [Get started with git](https://rogerdudler.github.io/git-guide) -* [How to create a pull request](https://help.github.com/articles/using-pull-requests) -* [An issue to work on](https://github.com/GitTools/GitVersion/labels/up-for-grabs) - We are on [Up for grabs](https://up-for-grabs.net/), our up for grabs issues are tagged `up-for-grabs` -* An understanding of our [architecture](https://gitversion.net/docs/learn/how-it-works#architecture) and how [we write tests](#writing-tests) +* [Get started with git](https://rogerdudler.github.io/git-guide) +* [How to create a pull request](https://help.github.com/articles/using-pull-requests) +* [An issue to work on](https://github.com/GitTools/GitVersion/labels/up-for-grabs) - We are on [Up for grabs](https://up-for-grabs.net/), our up for grabs issues are tagged `up-for-grabs` +* An understanding of our [architecture](https://gitversion.net/docs/learn/how-it-works#architecture) and how [we write tests](#writing-tests) Once you know how to create a pull request and have an issue to work on, just post a comment saying you will work on it. If you end up not being able to complete the task, please post another comment so others can pick it up. @@ -14,12 +14,12 @@ Issues are also welcome, [failing tests](#writing-tests) are even more welcome. ## Contribution Guidelines -* Try to use feature branches rather than developing on main. -* Please include tests covering the change. -* The documentation is stored in the repository under the [`docs`](docs) folder. - Have a look at the [documentation readme file](docs/readme.md) for guidance - on how to improve the documentation and please include documentation updates - with your PR. +* Try to use feature branches rather than developing on main. +* Please include tests covering the change. +* The documentation is stored in the repository under the [`docs`](docs) folder. + Have a look at the [documentation readme file](docs/readme.md) for guidance + on how to improve the documentation and please include documentation updates + with your PR. ## How it works @@ -50,6 +50,7 @@ var configurationBuilder = GitFlowConfigurationBuilder.New; We can then customize the configuration by chaining methods of the builder. At the end we build the configuration. For example: + ```csharp var configuration = configurationBuilder .WithDeploymentMode(DeploymentMode.ContinuousDeployment) @@ -61,9 +62,9 @@ var configuration = configurationBuilder We have a few fixtures for different scenarios. -* `EmptyRepositoryFixture` - Gives you an empty git repo to start with -* `RemoteRepositoryFixture` - A local repo tracking a test remote repository. The remote repo is available through the `Repository` property, the local is accessible via `LocalRepository` -* `BaseGitFlowRepositoryFixture` - A repo setup for GitFlow (has a develop branch checked out ready to go) +* `EmptyRepositoryFixture` - Gives you an empty git repo to start with +* `RemoteRepositoryFixture` - A local repo tracking a test remote repository. The remote repo is available through the `Repository` property, the local is accessible via `LocalRepository` +* `BaseGitFlowRepositoryFixture` - A repo setup for GitFlow (has a develop branch checked out ready to go) You can use a fixture by just `using` it. Like this @@ -97,18 +98,18 @@ Even better include the fix, but a failing test is a great start We use Cake for our build and deployment process. The way the release process is setup is: -1. We build releasable artifacts with GitHub Actions -2. We create a milestone for the release if it's not already created. Our milestones are named using the semver. - For example `5.12.0` or `6.0.0-beta.2` -3. We move all the closed issues and closed pull requests that are going to be included in the release to the milestone. -4. We check that all the issues and pull requests that are going to be included in the release have a label assigned, - otherwise it will fail the release. -5. We create a release in the GitHub UI, and create a tag and name it using the milestone name. For example `5.12.0` or `6.0.0-beta.2` -6. We specify if the release is a pre-release or latest release in the GitHub UI. -7. We publish the release. -8. The GitHub Actions will create a GitHub release and publish the artifacts to NuGet, Chocolatey, Docker, Homebrew - and other distribution channels. -9. The issues and pull requests will get updated with message specifying in which release it was included. +1. We build releasable artifacts with GitHub Actions +2. We create a milestone for the release if it's not already created. Our milestones are named using the semver. + For example `5.12.0` or `6.0.0-beta.2` +3. We move all the closed issues and closed pull requests that are going to be included in the release to the milestone. +4. We check that all the issues and pull requests that are going to be included in the release have a label assigned, + otherwise it will fail the release. +5. We create a release in the GitHub UI, and create a tag and name it using the milestone name. For example `5.12.0` or `6.0.0-beta.2` +6. We specify if the release is a pre-release or latest release in the GitHub UI. +7. We publish the release. +8. The GitHub Actions will create a GitHub release and publish the artifacts to NuGet, Chocolatey, Docker, Homebrew + and other distribution channels. +9. The issues and pull requests will get updated with message specifying in which release it was included. ## Code Style diff --git a/GitReleaseManager.yml b/GitReleaseManager.yml index 5a85f67383..8e0b3fb546 100644 --- a/GitReleaseManager.yml +++ b/GitReleaseManager.yml @@ -31,6 +31,7 @@ create: sha-section-heading: "SHA256 Hashes of the release artifacts" sha-section-line-format: "- `{1}\t- {0}`" allow-update-to-published: true + include-contributors: true close: use-issue-comments: true issue-comment: |- diff --git a/GitVersion.yml b/GitVersion.yml deleted file mode 100644 index 08802473ca..0000000000 --- a/GitVersion.yml +++ /dev/null @@ -1,6 +0,0 @@ -assembly-versioning-scheme: MajorMinorPatch -branches: - main: - label: beta - support: - label: beta diff --git a/README.md b/README.md index 684d8ee417..202043f4b5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![GitVersion – From git log to SemVer in no time][banner] +# ![GitVersion – From git log to SemVer in no time][banner] Versioning when using Git, solved. GitVersion looks at your git history and works out the [Semantic Version][semver] of the commit being built. @@ -6,20 +6,18 @@ works out the [Semantic Version][semver] of the commit being built. [![Build status][azure-pipeline-badge]][azure-pipeline] [![Build status][github-actions-badge]][github-actions] [![codecov][codecov-badge]][codecov] -[![Gitter][gitter-badge]][gitter] - -| Artifact | Stable | | -|:---------------------------|:-------------------------------------------------------------------|---------------------------------------------------------| -| **GitHub Release** | [![GitHub release][gh-rel-badge]][gh-rel] | | -| **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][gitversiontask] before v5.6.0 | -| **Homebrew** | [![homebrew][brew-badge]][brew] | | -| **Winget** | [![winget][winget-badge]][winget] | `winget install gitversion` | -| **Azure Pipeline Task** | [![Azure Pipeline Task][az-pipeline-task-badge]][az-pipeline-task] | | -| **Github Action** | [![Github Action][gh-actions-badge]][gh-actions] | | -| **Docker** | [![Docker Pulls][dockerhub-badge]][dockerhub] | | + +| Artifact | Stable | +|:---------------------------|:-------------------------------------------------------------------| +| **GitHub Release** | [![GitHub release][gh-rel-badge]][gh-rel] | +| **GitVersion.Portable** | [![Chocolatey][choco-badge]][choco] | +| **GitVersion.Tool** | [![NuGet][gvgt-badge]][gvgt] | +| **GitVersion.MsBuild** | [![NuGet][gvt-badge]][gvt] | +| **Homebrew** | [![homebrew][brew-badge]][brew] | +| **Winget** | [![winget][winget-badge]][winget] | +| **Azure Pipeline Task** | [![Azure Pipeline Task][az-pipeline-task-badge]][az-pipeline-task] | +| **Github Action** | [![Github Action][gh-actions-badge]][gh-actions] | +| **Docker** | [![Docker Pulls][dockerhub-badge]][dockerhub] | ## Compatibility @@ -27,13 +25,13 @@ GitVersion works on Windows, Linux, and Mac. ## Quick Links -* [Documentation][docs] -* [Contributing][contribute] -* [Why GitVersion][why] -* [Usage][usage] -* [How it works][how] -* [FAQ][faq] -* [Who is using GitVersion][who] +* [Documentation][docs] +* [Contributing][contribute] +* [Why GitVersion][why] +* [Usage][usage] +* [How it works][how] +* [FAQ][faq] +* [Who is using GitVersion][who] ## GitVersion in action! @@ -41,8 +39,8 @@ GitVersion works on Windows, Linux, and Mac. You are seeing: -* Pull requests being built as pre-release builds -* A branch called `release-1.0.0` producing beta v1 packages +* Pull requests being built as pre-release builds +* A branch called `release-1.0.0` producing beta v1 packages ## Icon @@ -50,44 +48,74 @@ You are seeing: designed by [David Chapman][app-icon-author] from The Noun Project. -[semver]: https://semver.org -[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 -[azure-pipeline]: https://dev.azure.com/GitTools/GitVersion/_build/latest?definitionId=1 -[azure-pipeline-badge]: https://dev.azure.com/GitTools/GitVersion/_apis/build/status/GitTools.GitVersion -[github-actions]: https://github.com/GitTools/GitVersion/actions -[github-actions-badge]: https://github.com/GitTools/GitVersion/workflows/CI/badge.svg -[codecov]: https://codecov.io/gh/GitTools/GitVersion -[codecov-badge]: https://codecov.io/gh/GitTools/GitVersion/branch/main/graph/badge.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 -[choco]: https://chocolatey.org/packages/GitVersion.Portable -[choco-badge]: https://img.shields.io/chocolatey/v/gitversion.portable.svg?logo=nuget -[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/ -[gvcl]: https://www.nuget.org/packages/GitVersion.CommandLine -[gvcl-badge]: https://img.shields.io/nuget/v/GitVersion.CommandLine.svg?logo=nuget -[gvgt]: https://www.nuget.org/packages/GitVersion.Tool -[gvgt-badge]: https://img.shields.io/nuget/v/GitVersion.Tool.svg?logo=nuget -[brew]: https://formulae.brew.sh/formula/gitversion -[brew-badge]: https://img.shields.io/homebrew/v/gitversion.svg?logo=homebrew -[winget]: https://github.com/microsoft/winget-pkgs/tree/master/manifests/g/GitTools/GitVersion -[winget-badge]: https://img.shields.io/badge/winget-v5.12.0-blue.svg?logo=microsoft -[dockerhub]: https://hub.docker.com/r/gittools/gitversion/ -[dockerhub-badge]: https://img.shields.io/docker/pulls/gittools/gitversion.svg?logo=docker -[az-pipeline-task]: https://marketplace.visualstudio.com/items?itemName=gittools.gittools -[az-pipeline-task-badge]: https://img.shields.io/badge/marketplace-gittools.gittools-blue?logo=azure-pipelines -[gh-actions]: https://github.com/marketplace/actions/gittools -[gh-actions-badge]: https://img.shields.io/badge/marketplace-gittools-blue?logo=github -[contribute]: https://github.com/GitTools/GitVersion/blob/main/CONTRIBUTING.md -[why]: https://gitversion.net/docs/learn/why -[usage]: https://gitversion.net/docs/usage -[how]: https://gitversion.net/docs/learn/how-it-works -[faq]: https://gitversion.net/docs/learn/faq -[who]: https://gitversion.net/docs/learn/who -[gv-in-action]: https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/input/docs/img/README.png -[banner]: https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/banner-1280x640.png -[app-icon]: https://thenounproject.com/term/tree/13389/ -[app-icon-author]: https://thenounproject.com/david.chapman +[semver]: https://semver.org + +[azure-pipeline]: https://dev.azure.com/GitTools/GitVersion/_build/latest?definitionId=1 + +[azure-pipeline-badge]: https://dev.azure.com/GitTools/GitVersion/_apis/build/status/GitTools.GitVersion + +[github-actions]: https://github.com/GitTools/GitVersion/actions + +[github-actions-badge]: https://github.com/GitTools/GitVersion/workflows/CI/badge.svg + +[codecov]: https://codecov.io/gh/GitTools/GitVersion + +[codecov-badge]: https://codecov.io/gh/GitTools/GitVersion/branch/main/graph/badge.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 + +[choco]: https://chocolatey.org/packages/GitVersion.Portable + +[choco-badge]: https://img.shields.io/chocolatey/v/gitversion.portable.svg?logo=nuget + +[gvt]: https://www.nuget.org/packages/GitVersion.MsBuild + +[gvt-badge]: https://img.shields.io/nuget/v/GitVersion.MsBuild.svg?logo=nuget + +[gvgt]: https://www.nuget.org/packages/GitVersion.Tool + +[gvgt-badge]: https://img.shields.io/nuget/v/GitVersion.Tool.svg?logo=nuget + +[brew]: https://formulae.brew.sh/formula/gitversion + +[brew-badge]: https://img.shields.io/homebrew/v/gitversion.svg?logo=homebrew + +[winget]: https://github.com/microsoft/winget-pkgs/tree/master/manifests/g/GitTools/GitVersion + +[winget-badge]: https://img.shields.io/winget/v/GitTools.GitVersion.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMeSURBVHgBrVS9axRREJ/3ds+QRPLtBxolYkRJYSNiKZGoaGdtI+gfIGhCCEgupb2llonYCmJhYZMDaysxClHwQriYXKI5xezOOPM+dt9uLlWyd4/3MW9+M/Obmacg+F486JolgCrs41Osf/95a87vdSjcL3g7jDjc1Dew6Itcl5VSQGTVyUn2/tTu3dvqhZGK1u95OQIH8y3vII7fqn5aNhTFSt87QHD5RhympWi58RciZUMTOtDyYffhgkprL6QAms9I9MmmV319MzXL+yoQWoHw7A34M/4jYS5zcpIzXqM7K+jLUFhVS68fkT+UIU6hUyyCOWVEk2raA9SUAeV4MWFqN2A9tYKit15OJc/DSMMoFOQ6MRoD9lIYib+IzkPd0Q/nrk8ZJ768ewpJq5Hd81FmkWcGuNGMAUxA5nCIl1aGkCYpdJ+6ApWuQah0D5p1mhbvp4xBfu9lacIR8AYyejDj0EZu98hzkqQZJQIuQykq5IqCHDgubQ5yvotGfF7CqOSaOOX1oFwUYa7Ysdh6iUEV5OWZe4aOMnsmgBK+Unl1hZUTFoJGspyR80pm2QvvfaMTcGZimhM8wGdY8Ex39sPpqw/h6MU7Lh9o9U20eU5jTBIXFphIvCcdQ+dh+PJdA3j2xgw0vn3Moog6B2D05hPoOHwEeoYvwernGqS/vu/qG7lv+6BQ89bQen0Jmmt16Bk4Doe4ck6OjbOn9rU9MXYtA9laX4HW9hZUJOmlfMhPZwnMSi6xycFt+PBqBrZ+1gu9IVT40Vz7AYvz3But1UyfEPOC4Fnnh5gdSl9odqc3akLt5TQbWXHy3IiA1xi8L9qASIM5SznxkvywF7RvCD/IC3kdaWKAJiwuTBaMbHJUtflJdmAdYk0uqUkQhWOCcTSVKErDbpYqYIB+iWThMfzeWIFNQ8ukMVyJwEWMAcVFPLX47Db5ms3q15WieYpds/3bSaGx+cc8WUO9FQZXbR/E8isck9AC1LbE8obhixHBsb6Ka16bh7KBwnPtZp0gzvnWNxSlSd4oJi85nxBQkVHjGxRts/nkksFK5/4DGLPsj2fzroIAAAAASUVORK5CYII= + +[dockerhub]: https://hub.docker.com/r/gittools/gitversion/ + +[dockerhub-badge]: https://img.shields.io/docker/pulls/gittools/gitversion.svg?logo=docker + +[az-pipeline-task]: https://marketplace.visualstudio.com/items?itemName=gittools.gittools + +[az-pipeline-task-badge]: https://img.shields.io/badge/marketplace-gittools-blue?logo=data:application/pdf;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABJlJREFUWIXFVk1sVFUU/u6dNzOd6fx2ftoGFNIfNa1prCW4ALHsGolIYmjQGH/CwmUXBl2gK0OihoUYE5G40GAEQ7QJ0IobQSEkLYLFH4QabSpUptPpTDs/773pzLvHRTvDm3lvpjOtxpOcTN69557vu+eec+YwIsL/KdK/4aRzz8WupubA4xKDrRZ7LS8yYxPZ4/RDX27dBLa8PLGnu7fjKxBYPee2ijgH8PG6CGwZvOptfbD1pNDqAwcAboUbWOcTeDb4R8CYfS1ZJLTl3zUT2Lr/xkvhVt82Ekb4TSGG9o12OOwc0cQSfp3OQVZLgySwDgLtg1e9nR0tR02w0bPZgofbXcVvt9OKjWGBr8cXIavcwIBjDbKhxTcCMLsgQK92K6GrzQUilKhN4ujeZCuxNUSg8/kxj1coq5aRsAdeCLUEtpm1D4+TVczGkM8Govy9BQYqEuh78WKPx2a9TmioCs4ZRyDYhErNS1YJlfqarGol58RKCCQAWNJYu8Sq5zJjDI3uAAioCJKQgWhCRchvvMjkXypKcmalCviycwuVv2e5Wi0OcHtDVRshGL77SUE0oRbfXxOEa5MpTEVLbQsiAUBeA6pFwMIscPgCFW+ul7TKMHpFQdClQJIYFtMEJWfMDEMSmpXUcnQApzsIgJkSaHJzLGQ0CKEDIYa5ZNGDqd98Lq/qCOQhhHlFNthcsNjsECYMgz4JPncj/F6BqZk08lrNPZEW4okLRQJCWAjceNjCOBzeJtPoNPuscLud0AhgxOF2cswntdWRibKxO9F9M9/03ywSAPEY9DUKAIzB5Q4CbKVgdRLySnC5HCi04WRaQawGcDWTvRyfS+2aGu5bKMIUavOBfZeGALxX2LBZHPAEmw1OQn4LvK5GEJZfN5mWEU3kDXZ6EUS5ZDQxdONkz4fle0zfHNr2fv8qZ+wwANgtjXCHwgZwXxn47CrgWVkej0eiA9NntyfM9ll5V2vbe+ktgN5gYLccDf5Jp8/zFACE/ZLh5rOJXEVgIkJ6fuHAbyd6DlcjaEj9P09tfxOE19Ss49FfjnfvlhfTX4R8ZeApGZF4zvCnU9AlRUE8cgdJFv+kanjMIlAuTx+c6gmGAtcz2XvglW5ORMgkYlCzGRAj5HMiNHO6P1bNf9V5YODgdGtvR/AKGEMkQZiNpRGp8OZLiozUQgyi0ORrbAkcAD44m3royHDq7SNfJh/Tb547tOnu3zH5MxKUi8bme/+Yip8QgqBXTRBSsSgW4rPIUx6CqKg1EyANnYzjdWblveUGnx5o3v/zzdv3jxzaPHHr8+7nMsnkGVq54JKiYP7ubWSyaQiQIRdqkZpGspF3uyIAwAZP2VqV8H25jAJihCWRqTqNS5JzVRp1zYRhJbxLI3pE0TIrK3VP4wapayacPfPEsBD0iv6dq2kyubrP0ggQnn3/dLp0KSd+HHrGM1b4nhvdeSzw5Hkw4KN6yNdGALQDhB0lS5y9A2BMvzQ/uvNY08AFDpCht+ulQZOzNREQsjLOnY7dZgbcit/N1uPn+o96B769BkLAbJ/Ap+Ln+9Nme3pZtRP+1/IPO814AQ1WwqwAAAAASUVORK5CYII= + +[gh-actions]: https://github.com/marketplace/actions/gittools + +[gh-actions-badge]: https://img.shields.io/badge/marketplace-gittools-blue?logo=github + +[contribute]: https://github.com/GitTools/GitVersion/blob/main/CONTRIBUTING.md + +[why]: https://gitversion.net/docs/learn/why + +[usage]: https://gitversion.net/docs/usage + +[how]: https://gitversion.net/docs/learn/how-it-works + +[faq]: https://gitversion.net/docs/learn/faq + +[who]: https://gitversion.net/docs/learn/who + +[gv-in-action]: https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/input/docs/img/README.png + +[banner]: https://raw.githubusercontent.com/GitTools/graphics/master/GitVersion/banner-1280x640.png + +[app-icon]: https://thenounproject.com/term/tree/13389/ + +[app-icon-author]: https://thenounproject.com/david.chapman diff --git a/SECURITY.md b/SECURITY.md index 6e0e279f39..8f44809e2f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,28 +2,28 @@ ## Supported Versions -| Version | Supported | -| --------: | :----------------: | -| 5.x | :white_check_mark: | -| ⋜ 5.x | :x: | +| Version | Supported | +|--------:|:--------------------:| +| 6.x | :white\_check\_mark: | +| < 6.x | :x: | ## Reporting Security Issues ⚠ **Please do not report security vulnerabilities through public GitHub issues.** ⚠ -Instead, please send an email to [security@gitversion.net](mailto:security@gitversion.net). +Instead, please send an email to . You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. 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/.run/Artifacts DotnetTool Test.run.xml b/build/.run/Artifacts DotnetTool Test.run.xml index 20fd374236..c4c33a96bc 100644 --- a/build/.run/Artifacts DotnetTool Test.run.xml +++ b/build/.run/Artifacts DotnetTool Test.run.xml @@ -1,7 +1,7 @@ - - \ No newline at end of file + diff --git a/build/.run/Artifacts Executable Test.run.xml b/build/.run/Artifacts Executable Test.run.xml index e28ceedea3..85538064f0 100644 --- a/build/.run/Artifacts Executable Test.run.xml +++ b/build/.run/Artifacts Executable Test.run.xml @@ -1,6 +1,6 @@ - diff --git a/build/.run/Artifacts MsBuildFull Test.run.xml b/build/.run/Artifacts MsBuildFull Test.run.xml index 31b7b025f3..537874156c 100644 --- a/build/.run/Artifacts MsBuildFull Test.run.xml +++ b/build/.run/Artifacts MsBuildFull Test.run.xml @@ -1,6 +1,6 @@ - diff --git a/build/.run/Artifacts Prepare.run.xml b/build/.run/Artifacts Prepare.run.xml index 20457fb0af..2f1148d96e 100644 --- a/build/.run/Artifacts Prepare.run.xml +++ b/build/.run/Artifacts Prepare.run.xml @@ -1,7 +1,7 @@ - - \ No newline at end of file + diff --git a/build/.run/Artifacts Test.run.xml b/build/.run/Artifacts Test.run.xml index 23914721f6..2463d6a13c 100644 --- a/build/.run/Artifacts Test.run.xml +++ b/build/.run/Artifacts Test.run.xml @@ -1,7 +1,7 @@ - - \ No newline at end of file + diff --git a/build/.run/Build Docs.run.xml b/build/.run/Build Docs.run.xml index 2057ab88d0..43431e74bb 100644 --- a/build/.run/Build Docs.run.xml +++ b/build/.run/Build Docs.run.xml @@ -1,6 +1,6 @@ -