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..a1d424e510 --- /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@v1 + 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..7bf0945382 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: + dockerDistro: description: 'Linux Distro' required: true - targetFramework: + dotnetVersion: description: '.net version' required: true docker_registry_username: @@ -32,7 +32,7 @@ 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.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry dockerhub - name: Login to GitHub uses: docker/login-action@v3 @@ -43,4 +43,4 @@ 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.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github diff --git a/.github/actions/docker-publish/action.yml b/.github/actions/docker-publish/action.yml index feff913274..d65fbe5aee 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: + dockerDistro: description: 'Linux Distro' required: true - targetFramework: + dotnetVersion: description: '.net version' required: true docker_registry_username: @@ -35,7 +35,7 @@ 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.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry dockerhub --verbosity=diagnostic - name: Login to GitHub uses: docker/login-action@v3 @@ -46,4 +46,4 @@ 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.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/actions/docker-test/action.yml b/.github/actions/docker-test/action.yml index 943bc4c75b..7e450d2d8e 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: + dockerDistro: description: 'Linux Distro' default: 'debian.12' - targetFramework: + dotnetVersion: description: '.net version' default: '8.0' @@ -17,8 +17,8 @@ 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.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --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.dotnetVersion }} --docker_distro=${{ inputs.dockerDistro }} --docker_registry github --verbosity=diagnostic diff --git a/.github/workflows/_artifacts_linux.yml b/.github/workflows/_artifacts_linux.yml index 86e13a9256..ceb3e7c969 100644 --- a/.github/workflows/_artifacts_linux.yml +++ b/.github/workflows/_artifacts_linux.yml @@ -7,28 +7,25 @@ on: arch: required: true type: string - + dockerDistros: + required: true + type: string + dotnetVersions: + required: true + type: string env: DOTNET_INSTALL_DIR: "./.dotnet" DOTNET_ROLL_FORWARD: "Major" jobs: artifacts: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} + name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false - matrix: - distro: - - alpine.3.20 - - centos.stream.9 - - debian.12 - - fedora.40 - - ubuntu.20.04 - - ubuntu.22.04 - - ubuntu.24.04 - targetFramework: [ '8.0', '6.0' ] - + matrix: + dockerDistro: ${{ fromJson(inputs.dockerDistros) }} + dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }} steps: - name: Checkout @@ -37,7 +34,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 @@ -48,9 +45,9 @@ 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: '[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.dotnetVersion }} --docker_distro=${{ matrix.dockerDistro }} \ No newline at end of file diff --git a/.github/workflows/_artifacts_windows.yml b/.github/workflows/_artifacts_windows.yml index 0f569701a5..6c1832961e 100644 --- a/.github/workflows/_artifacts_windows.yml +++ b/.github/workflows/_artifacts_windows.yml @@ -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..75ed54e3c2 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-latest, ubuntu-latest, 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 @@ -44,7 +44,7 @@ jobs: - name: 'Upload native packages' uses: actions/upload-artifact@v4 - if: matrix.os != 'windows-latest' && matrix.os != 'macos-13' + if: matrix.os != 'windows-latest' 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 edecf7f857..9781d00c46 100644 --- a/.github/workflows/_docker.yml +++ b/.github/workflows/_docker.yml @@ -7,28 +7,25 @@ on: arch: required: true type: string - + dockerDistros: + required: true + type: string + dotnetVersions: + required: true + type: string env: DOTNET_INSTALL_DIR: "./.dotnet" DOTNET_ROLL_FORWARD: "Major" jobs: docker: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} + name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false matrix: - distro: - - alpine.3.20 - - centos.stream.9 - - debian.12 - - fedora.40 - - ubuntu.20.04 - - ubuntu.22.04 - - ubuntu.24.04 - targetFramework: [ '8.0', '6.0' ] - + dockerDistro: ${{ fromJson(inputs.dockerDistros) }} + dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }} steps: - name: Checkout @@ -37,7 +34,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 @@ -65,16 +62,16 @@ jobs: uses: ./.github/actions/docker-test with: arch: ${{ inputs.arch }} - distro: ${{ matrix.distro }} - targetFramework: ${{ matrix.targetFramework }} + dockerDistro: ${{ matrix.dockerDistro }} + dotnetVersion: ${{ matrix.dotnetVersion }} - 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 }} + dockerDistro: ${{ matrix.dockerDistro }} + dotnetVersion: ${{ matrix.dotnetVersion }} docker_registry_username: ${{ secrets.DOCKER_USERNAME }} docker_registry_password: ${{ secrets.DOCKER_PASSWORD }} github_registry_username: ${{ github.repository_owner }} diff --git a/.github/workflows/_docker_manifests.yml b/.github/workflows/_docker_manifests.yml index 0049c2438f..abb3b5cd05 100644 --- a/.github/workflows/_docker_manifests.yml +++ b/.github/workflows/_docker_manifests.yml @@ -1,27 +1,25 @@ on: workflow_call: - + inputs: + dockerDistros: + required: true + type: string + dotnetVersions: + required: true + type: string env: DOTNET_INSTALL_DIR: "./.dotnet" DOTNET_ROLL_FORWARD: "Major" jobs: manifest: - name: ${{ matrix.distro }} - net${{ matrix.targetFramework }} + name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: - distro: - - alpine.3.20 - - centos.stream.9 - - debian.12 - - fedora.40 - - ubuntu.20.04 - - ubuntu.22.04 - - ubuntu.24.04 - targetFramework: [ '8.0', '6.0' ] - + dockerDistro: ${{ fromJson(inputs.dockerDistros) }} + dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }} steps: - name: Checkout @@ -30,7 +28,7 @@ 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 @@ -51,8 +49,8 @@ jobs: 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 }} + dockerDistro: ${{ matrix.dockerDistro }} + dotnetVersion: ${{ matrix.dotnetVersion }} 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..5c5d485933 100644 --- a/.github/workflows/_prepare.yml +++ b/.github/workflows/_prepare.yml @@ -1,13 +1,19 @@ on: workflow_call: - + outputs: + dockerDistros: + description: 'List of Docker distros' + value: ${{ jobs.set_matrix.outputs.dockerDistros }} + dotnetVersions: + description: 'List of .NET versions' + value: ${{ jobs.set_matrix.outputs.dotnetVersions }} jobs: prepare: name: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest, macos-13, macos-14] + os: [windows-latest, ubuntu-latest, macos-15] runs-on: ${{ matrix.os }} steps: @@ -40,3 +46,22 @@ jobs: name: '[Prepare]' shell: pwsh run: dotnet run/build.dll --target=BuildPrepare + set_matrix: + needs: [ prepare ] + name: Set Matrix + runs-on: ubuntu-latest + outputs: + dockerDistros: ${{ steps.set_matrix.outputs.dockerDistros }} + dotnetVersions: ${{ steps.set_matrix.outputs.dotnetVersions }} + 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..d9aec579e7 100644 --- a/.github/workflows/_publish.yml +++ b/.github/workflows/_publish.yml @@ -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 165c19d078..594e2a55ae 100644 --- a/.github/workflows/_unit_tests.yml +++ b/.github/workflows/_unit_tests.yml @@ -1,20 +1,23 @@ on: workflow_call: - + inputs: + dotnetVersions: + required: true + type: string env: DOTNET_INSTALL_DIR: "./.dotnet" DOTNET_ROLL_FORWARD: "Major" jobs: unit_test: - name: ${{ matrix.os }} - net${{ matrix.targetFramework }} + name: ${{ matrix.os }} - net${{ matrix.dotnetVersion }} env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest, macos-13, macos-14] - targetFramework: [ '8.0', '6.0' ] + os: [windows-latest, ubuntu-latest, macos-15] + dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }} 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.dotnetVersion }} - name: Test Summary uses: test-summary/action@v2.4 - if: matrix.targetFramework == '8.0' + if: matrix.dotnetVersion == '8.0' with: paths: artifacts/test-results/*.results.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a85688e8db..1249908800 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,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 ] @@ -51,6 +53,8 @@ jobs: name: Test needs: [ prepare ] uses: ./.github/workflows/_unit_tests.yml + with: + dotnetVersions: ${{ needs.prepare.outputs.dotnetVersions }} secrets: inherit artifacts_windows_test: @@ -59,7 +63,7 @@ jobs: uses: ./.github/workflows/_artifacts_windows.yml artifacts_linux_test: - needs: [ build ] + needs: [ prepare, build ] name: Artifacts Linux (${{ matrix.arch }}) strategy: fail-fast: false @@ -73,9 +77,11 @@ jobs: with: runner: ${{ matrix.runner }} arch: ${{ matrix.arch }} + dockerDistros: ${{ needs.prepare.outputs.dockerDistros }} + dotnetVersions: ${{ needs.prepare.outputs.dotnetVersions }} docker_linux_images: - needs: [ build ] + needs: [ prepare, build ] name: Docker Images (${{ matrix.arch }}) strategy: fail-fast: false @@ -90,12 +96,17 @@ jobs: with: runner: ${{ matrix.runner }} arch: ${{ matrix.arch }} + dockerDistros: ${{ needs.prepare.outputs.dockerDistros }} + dotnetVersions: ${{ needs.prepare.outputs.dotnetVersions }} secrets: inherit docker_linux_manifests: - needs: [ docker_linux_images ] + needs: [ prepare, docker_linux_images ] name: Docker Manifests uses: ./.github/workflows/_docker_manifests.yml + with: + dockerDistros: ${{ needs.prepare.outputs.dockerDistros }} + dotnetVersions: ${{ needs.prepare.outputs.dotnetVersions }} secrets: inherit publish: @@ -118,25 +129,14 @@ 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 - - - uses: actions/download-artifact@v4 - name: Download native windows packages - with: - name: native-Windows - path: ${{ github.workspace }}/artifacts/packages/native + name: Restore Artifacts + uses: ./.github/actions/artifacts-restore - - uses: actions/download-artifact@v4 - name: Download native macos packages - with: - name: native-macOS - path: ${{ github.workspace }}/artifacts/packages/native + name: Attetstation + if: ${{ github.event_name == 'repository_dispatch' }} + uses: ./.github/actions/artifacts-attest - name: '[Release]' shell: pwsh diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0597068156..b05b693cd2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -71,7 +71,6 @@ jobs: uses: actions/setup-dotnet@v4 with: global-json-file: global.json - - name: '[Prepare]' if: steps.cache-cake.outputs.cache-hit != 'true' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bc3fb3b7aa..271abaebcc 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-latest steps: - @@ -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 @@ -127,7 +123,7 @@ jobs: publish: name: Publish docs needs: [ validate ] - runs-on: windows-latest + runs-on: ubuntu-latest 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/.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 ec20701053..8d5b4408b7 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -11,14 +11,19 @@ ### 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: - ``` log + ```log * 1f1cfb4 52 minutes ago (HEAD -> feature/just-a-test) * 1f9654d 54 minutes ago (release/1.1.0) * be72411 56 minutes ago (develop) @@ -26,34 +31,49 @@ ``` * 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 + ```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 `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 @@ -61,14 +81,21 @@ * 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`. ### Legacy Output Variables @@ -87,9 +114,9 @@ The following legacy output variables have been removed in this version: ## 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]. + 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. + maintaining GitVersion easier. ## v4.0.0 @@ -107,27 +134,29 @@ work for you * `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. + override. * The default keys are: `master`, `develop`, `feature`, `release`, `pull-request`, - `hotfix` and `support` + `hotfix` and `support` * Just run `GitVersion.exe` in your project directory and it will tell you - what to change your config keys to + 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. + 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 + 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 + 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 + `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 fa2ab0c87e..ac82b46b95 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,9 +17,9 @@ Issues are also welcome, [failing tests](#writing-tests) are even more welcome. * 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. + 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 @@ -100,15 +100,15 @@ We use Cake for our build and deployment process. The way the release process 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` + 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. + 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. + 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/README.md b/README.md index b9498ad3b2..7ab9427295 100644 --- a/README.md +++ b/README.md @@ -49,41 +49,78 @@ 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 -[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-v6.0.2-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 + +[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 + +[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-v6.0.3-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 diff --git a/SECURITY.md b/SECURITY.md index 6e07e80a06..5d4f3799c2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,14 +4,14 @@ | Version | Supported | | --------: | :----------------: | -| 5.x | :white_check_mark: | +| 5.x | :white\_check\_mark: | | ⋜ 5.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. diff --git a/build/.run/Artifacts DotnetTool Test.run.xml b/build/.run/Artifacts DotnetTool Test.run.xml index 5d80a2eedf..5a4546c2b5 100644 --- a/build/.run/Artifacts DotnetTool Test.run.xml +++ b/build/.run/Artifacts DotnetTool Test.run.xml @@ -1,7 +1,7 @@