diff --git a/.github/actions/artifacts-attest/action.yml b/.github/actions/artifacts-attest/action.yml index 7722489c36..aa4547a256 100644 --- a/.github/actions/artifacts-attest/action.yml +++ b/.github/actions/artifacts-attest/action.yml @@ -4,10 +4,9 @@ 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 + - name: 'Attestation' + uses: actions/attest-build-provenance@v4.1.0 + with: + subject-path: | + ${{ github.workspace }}/artifacts/packages/native + ${{ github.workspace }}/artifacts/packages/nuget diff --git a/.github/actions/artifacts-restore/action.yml b/.github/actions/artifacts-restore/action.yml index acca453639..b69757c8c1 100644 --- a/.github/actions/artifacts-restore/action.yml +++ b/.github/actions/artifacts-restore/action.yml @@ -4,27 +4,26 @@ description: 'Artifacts restore' runs: using: 'composite' steps: - - - 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 - - - uses: actions/download-artifact@v4 - name: Download native macos packages - with: - 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 + - uses: actions/download-artifact@v8 + name: Download native linux packages + with: + name: native-Linux + path: ${{ github.workspace }}/artifacts/packages/native + + - uses: actions/download-artifact@v8 + name: Download native windows packages + with: + name: native-Windows + path: ${{ github.workspace }}/artifacts/packages/native + + - uses: actions/download-artifact@v8 + name: Download native macos packages + with: + name: native-macOS + path: ${{ github.workspace }}/artifacts/packages/native + + - uses: actions/download-artifact@v8 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget diff --git a/.github/actions/cache-restore/action.yml b/.github/actions/cache-restore/action.yml index 84201a529a..192a459441 100644 --- a/.github/actions/cache-restore/action.yml +++ b/.github/actions/cache-restore/action.yml @@ -4,22 +4,21 @@ description: 'Cache restore' runs: using: 'composite' steps: - - - name: Use cached cake frosting - id: cache-cake - uses: actions/cache@v5 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v5 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v5 - with: - global-json-file: global.json + - name: Use cached cake frosting + id: cache-cake + uses: actions/cache@v5 + with: + path: run + key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + + - name: Use cached tools + id: cache-tools + uses: actions/cache@v5 + with: + path: tools + key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json diff --git a/.github/actions/docker-manifests/action.yml b/.github/actions/docker-manifests/action.yml index 2d9d65c1ac..5c1acd4771 100644 --- a/.github/actions/docker-manifests/action.yml +++ b/.github/actions/docker-manifests/action.yml @@ -23,30 +23,29 @@ inputs: runs: using: 'composite' steps: - - - name: Login to DockerHub - uses: docker/login-action@v4 - with: - username: ${{ inputs.docker_registry_username }} - password: ${{ inputs.docker_registry_password }} - - - name: '[Docker Publish Manifests] DockerHub' - shell: pwsh - run: | + - name: Login to DockerHub + uses: docker/login-action@v4 + with: + username: ${{ inputs.docker_registry_username }} + password: ${{ inputs.docker_registry_password }} + + - name: '[Docker Publish Manifests] DockerHub' + shell: pwsh + 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@v4 - with: - registry: ghcr.io - username: ${{ inputs.github_registry_username }} - password: ${{ inputs.github_registry_password }} - - - name: '[Docker Publish Manifests] GitHub' - shell: pwsh - run: | + + - name: Login to GitHub + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ inputs.github_registry_username }} + password: ${{ inputs.github_registry_password }} + + - name: '[Docker Publish Manifests] GitHub' + shell: pwsh + 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 4a645e4bdd..8835c1e733 100644 --- a/.github/actions/docker-publish/action.yml +++ b/.github/actions/docker-publish/action.yml @@ -26,30 +26,29 @@ inputs: runs: using: 'composite' steps: - - - name: Login to DockerHub - uses: docker/login-action@v4 - with: - username: ${{ inputs.docker_registry_username }} - password: ${{ inputs.docker_registry_password }} - - - name: '[Docker Publish] DockerHub' - shell: pwsh - run: | + - name: Login to DockerHub + uses: docker/login-action@v4 + with: + username: ${{ inputs.docker_registry_username }} + password: ${{ inputs.docker_registry_password }} + + - name: '[Docker Publish] DockerHub' + shell: pwsh + 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@v4 - with: - registry: ghcr.io - username: ${{ inputs.github_registry_username }} - password: ${{ inputs.github_registry_password }} - - - name: '[Docker Publish] GitHub' - shell: pwsh - run: | + + - name: Login to GitHub + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ inputs.github_registry_username }} + password: ${{ inputs.github_registry_password }} + + - name: '[Docker Publish] GitHub' + shell: pwsh + 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 index af83f0cc85..2e43c229be 100644 --- a/.github/actions/docker-setup/action.yml +++ b/.github/actions/docker-setup/action.yml @@ -2,9 +2,9 @@ name: 'Docker Setup' description: 'Setups the docker engine' runs: - using: 'composite' - steps: - - name: Set up Docker - uses: docker/setup-docker-action@v5 - with: - daemon-config: '{ "features": { "containerd-snapshotter": true } }' + using: 'composite' + steps: + - name: Set up Docker + uses: docker/setup-docker-action@v5 + with: + daemon-config: '{ "features": { "containerd-snapshotter": true } }' diff --git a/.github/actions/docker-test/action.yml b/.github/actions/docker-test/action.yml index 5b8e20bba2..caba8d0313 100644 --- a/.github/actions/docker-test/action.yml +++ b/.github/actions/docker-test/action.yml @@ -14,27 +14,26 @@ inputs: runs: using: 'composite' steps: - - - name: '[Docker Build & Test] DockerHub' - uses: nick-fields/retry@v3 - with: - shell: pwsh - timeout_minutes: 30 - max_attempts: 3 - retry_on: error - command: | - 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' - uses: nick-fields/retry@v3 - with: - shell: pwsh - timeout_minutes: 30 - max_attempts: 3 - retry_on: error - command: | - dotnet run/docker.dll --target=DockerTest ` - --arch=${{ inputs.arch }} --dotnet_version=${{ inputs.dotnet_version }} ` - --docker_distro=${{ inputs.docker_distro }} --docker_registry github --verbosity=diagnostic + - name: '[Docker Build & Test] DockerHub' + uses: nick-fields/retry@v3 + with: + shell: pwsh + timeout_minutes: 30 + max_attempts: 3 + retry_on: error + command: | + 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' + uses: nick-fields/retry@v3 + with: + shell: pwsh + timeout_minutes: 30 + max_attempts: 3 + retry_on: error + command: | + 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/workflows/_artifacts_linux.yml b/.github/workflows/_artifacts_linux.yml index f6484942fd..6926271591 100644 --- a/.github/workflows/_artifacts_linux.yml +++ b/.github/workflows/_artifacts_linux.yml @@ -28,39 +28,38 @@ jobs: docker_distro: ${{ fromJson(inputs.docker_distros) }} dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore - - - uses: actions/download-artifact@v8 - name: Download nuget packages - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - uses: actions/download-artifact@v8 - name: Download native packages - with: - name: native-Linux - path: ${{ github.workspace }}/artifacts/packages/native - - - name: Set up Docker - uses: ./.github/actions/docker-setup - - - name: '[Test Artifacts]' - uses: nick-fields/retry@v3 - with: - shell: pwsh - timeout_minutes: 30 - max_attempts: 3 - retry_on: error - command: | - dotnet run/artifacts.dll ` - --target=ArtifactsTest --arch=${{ inputs.arch }} ` - --dotnet_version=${{ matrix.dotnet_version }} ` - --docker_distro=${{ matrix.docker_distro }} + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Restore State + uses: ./.github/actions/cache-restore + + - uses: actions/download-artifact@v8 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + + - uses: actions/download-artifact@v8 + name: Download native packages + with: + name: native-Linux + path: ${{ github.workspace }}/artifacts/packages/native + + - name: Set up Docker + uses: ./.github/actions/docker-setup + + - name: '[Test Artifacts]' + uses: nick-fields/retry@v3 + with: + shell: pwsh + timeout_minutes: 30 + max_attempts: 3 + retry_on: error + command: | + dotnet run/artifacts.dll ` + --target=ArtifactsTest --arch=${{ inputs.arch }} ` + --dotnet_version=${{ matrix.dotnet_version }} ` + --docker_distro=${{ matrix.docker_distro }} diff --git a/.github/workflows/_artifacts_windows.yml b/.github/workflows/_artifacts_windows.yml index e710c0de9c..d7d5b3e0b4 100644 --- a/.github/workflows/_artifacts_windows.yml +++ b/.github/workflows/_artifacts_windows.yml @@ -15,21 +15,20 @@ jobs: package: [ Executable, MsBuildFull ] steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore - - - uses: actions/download-artifact@v8 - name: Download nuget packages - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - name: '[Test Artifacts]' - shell: pwsh - run: dotnet run/artifacts.dll --target=Artifacts${{ matrix.package }}Test + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Restore State + uses: ./.github/actions/cache-restore + + - uses: actions/download-artifact@v8 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + + - name: '[Test Artifacts]' + shell: pwsh + run: dotnet run/artifacts.dll --target=Artifacts${{ matrix.package }}Test diff --git a/.github/workflows/_build.yml b/.github/workflows/_build.yml index 08eeac7b10..a3edd1253b 100644 --- a/.github/workflows/_build.yml +++ b/.github/workflows/_build.yml @@ -11,40 +11,39 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2025-vs2026, ubuntu-24.04, macos-26] + os: [ windows-2025-vs2026, ubuntu-24.04, macos-26 ] runs-on: ${{ matrix.os }} steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore - - - name: '[Build]' - shell: pwsh - run: dotnet run/build.dll --target=Package - - - name: 'Upload nuget packages' - uses: actions/upload-artifact@v7 - if: matrix.os == 'windows-2025-vs2026' - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - name: 'Upload native packages' - uses: actions/upload-artifact@v7 - if: matrix.os == 'windows-2025-vs2026' - with: - name: native-${{ runner.os }} - path: ${{ github.workspace }}/artifacts/packages/native/*.zip - - - name: 'Upload native packages' - uses: actions/upload-artifact@v7 - if: matrix.os != 'windows-2025-vs2026' - with: - name: native-${{ runner.os }} - path: ${{ github.workspace }}/artifacts/packages/native/*.tar.gz + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Restore State + uses: ./.github/actions/cache-restore + + - name: '[Build]' + shell: pwsh + run: dotnet run/build.dll --target=Package + + - name: 'Upload nuget packages' + uses: actions/upload-artifact@v7 + if: matrix.os == 'windows-2025-vs2026' + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + + - name: 'Upload native packages' + uses: actions/upload-artifact@v7 + if: matrix.os == 'windows-2025-vs2026' + with: + name: native-${{ runner.os }} + path: ${{ github.workspace }}/artifacts/packages/native/*.zip + + - name: 'Upload native packages' + uses: actions/upload-artifact@v7 + if: matrix.os != 'windows-2025-vs2026' + 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 219be63028..d34bc7949a 100644 --- a/.github/workflows/_docker.yml +++ b/.github/workflows/_docker.yml @@ -34,47 +34,46 @@ jobs: docker_distro: ${{ fromJson(inputs.docker_distros) }} dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore - - - uses: actions/download-artifact@v8 - name: Download nuget packages - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - name: Set up Docker - uses: ./.github/actions/docker-setup - - - name: Docker Test - if: success() && inputs.publish_images == false - uses: ./.github/actions/docker-test - with: - arch: ${{ inputs.arch }} - docker_distro: ${{ matrix.docker_distro }} - dotnet_version: ${{ matrix.dotnet_version }} - - - name: Load DockerHub credentials - id: dockerhub-creds - if: success() && inputs.publish_images - uses: gittools/cicd/dockerhub-creds@v1 - with: - op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - - - name: Docker Publish - if: success() && inputs.publish_images - uses: ./.github/actions/docker-publish - with: - arch: ${{ inputs.arch }} - docker_distro: ${{ matrix.docker_distro }} - dotnet_version: ${{ matrix.dotnet_version }} - docker_registry_username: ${{ steps.dockerhub-creds.outputs.docker_username }} - docker_registry_password: ${{ steps.dockerhub-creds.outputs.docker_password }} - github_registry_username: ${{ github.repository_owner }} - github_registry_password: ${{ github.token }} + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Restore State + uses: ./.github/actions/cache-restore + + - uses: actions/download-artifact@v8 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + + - name: Set up Docker + uses: ./.github/actions/docker-setup + + - name: Docker Test + if: success() && inputs.publish_images == false + uses: ./.github/actions/docker-test + with: + arch: ${{ inputs.arch }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} + + - name: Load DockerHub credentials + id: dockerhub-creds + if: success() && inputs.publish_images + uses: gittools/cicd/dockerhub-creds@v1 + with: + op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + + - name: Docker Publish + if: success() && inputs.publish_images + uses: ./.github/actions/docker-publish + with: + arch: ${{ inputs.arch }} + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} + docker_registry_username: ${{ steps.dockerhub-creds.outputs.docker_username }} + docker_registry_password: ${{ steps.dockerhub-creds.outputs.docker_password }} + github_registry_username: ${{ github.repository_owner }} + github_registry_password: ${{ github.token }} diff --git a/.github/workflows/_docker_manifests.yml b/.github/workflows/_docker_manifests.yml index ee0d79a531..b92af58dad 100644 --- a/.github/workflows/_docker_manifests.yml +++ b/.github/workflows/_docker_manifests.yml @@ -28,32 +28,31 @@ jobs: docker_distro: ${{ fromJson(inputs.docker_distros) }} dotnet_version: ${{ fromJson(inputs.dotnet_versions) }} steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore - - - name: Set up Docker - uses: ./.github/actions/docker-setup - - - name: Load DockerHub credentials - if: inputs.publish_manifests - id: dockerhub-creds - uses: gittools/cicd/dockerhub-creds@v1 - with: - op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - - - name: Docker Manifests - uses: ./.github/actions/docker-manifests - if: inputs.publish_manifests - with: - docker_distro: ${{ matrix.docker_distro }} - dotnet_version: ${{ matrix.dotnet_version }} - docker_registry_username: ${{ steps.dockerhub-creds.outputs.docker_username }} - docker_registry_password: ${{ steps.dockerhub-creds.outputs.docker_password }} - github_registry_username: ${{ github.repository_owner }} - github_registry_password: ${{ github.token }} + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Restore State + uses: ./.github/actions/cache-restore + + - name: Set up Docker + uses: ./.github/actions/docker-setup + + - name: Load DockerHub credentials + if: inputs.publish_manifests + id: dockerhub-creds + uses: gittools/cicd/dockerhub-creds@v1 + with: + op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + + - name: Docker Manifests + uses: ./.github/actions/docker-manifests + if: inputs.publish_manifests + with: + docker_distro: ${{ matrix.docker_distro }} + dotnet_version: ${{ matrix.dotnet_version }} + docker_registry_username: ${{ steps.dockerhub-creds.outputs.docker_username }} + docker_registry_password: ${{ steps.dockerhub-creds.outputs.docker_password }} + github_registry_username: ${{ github.repository_owner }} + github_registry_password: ${{ github.token }} diff --git a/.github/workflows/_prepare.yml b/.github/workflows/_prepare.yml index 9a73269762..6a6bf82ec3 100644 --- a/.github/workflows/_prepare.yml +++ b/.github/workflows/_prepare.yml @@ -18,39 +18,39 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2025-vs2026, ubuntu-24.04, macos-26] + os: [ windows-2025-vs2026, ubuntu-24.04, macos-26 ] runs-on: ${{ matrix.os }} steps: - - - name: Checkout - uses: actions/checkout@v6 - - - name: Cache cake frosting - id: cache-cake - uses: actions/cache@v5 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - name: Use cached tools - id: cache-tools - uses: actions/cache@v5 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v5 - with: - global-json-file: global.json - - - name: '[Build]' - if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/ --configuration=Release - - - name: '[Prepare]' - shell: pwsh - run: dotnet run/build.dll --target=BuildPrepare + - name: Checkout + uses: actions/checkout@v6 + + - name: Cache cake frosting + id: cache-cake + uses: actions/cache@v5 + with: + path: run + key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + + - name: Use cached tools + id: cache-tools + uses: actions/cache@v5 + with: + path: tools + key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json + + - name: '[Build]' + if: steps.cache-cake.outputs.cache-hit != 'true' + run: dotnet build build/ --configuration=Release + + - name: '[Prepare]' + shell: pwsh + run: dotnet run/build.dll --target=BuildPrepare set_matrix: needs: [ prepare ] name: Set Matrix @@ -59,14 +59,13 @@ jobs: docker_distros: ${{ steps.set_matrix.outputs.docker_distros }} dotnet_versions: ${{ steps.set_matrix.outputs.dotnet_versions }} steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v6 - - - name: Restore State + + - name: Restore State uses: ./.github/actions/cache-restore - - - name: '[Matrix]' + + - name: '[Matrix]' id: set_matrix shell: pwsh run: dotnet run/config.dll --target=SetMatrix diff --git a/.github/workflows/_publish.yml b/.github/workflows/_publish.yml index 42068fe9f7..f6cad14a2b 100644 --- a/.github/workflows/_publish.yml +++ b/.github/workflows/_publish.yml @@ -19,42 +19,39 @@ jobs: taskName: [ NuGet, Chocolatey ] steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore - - - uses: actions/download-artifact@v8 - name: Download nuget packages - with: - name: nuget - path: ${{ github.workspace }}/artifacts/packages/nuget - - - - name: Load NuGet credentials - id: nuget-creds - if: inputs.publish_packages - uses: gittools/cicd/nuget-creds@v1 - with: - op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - - - name: Load Chocolatey credentials - id: choco-creds - if: inputs.publish_packages - uses: gittools/cicd/choco-creds@v1 - with: - op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - - - - name: '[Publish]' - if: inputs.publish_packages - shell: pwsh - run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }} - env: - GITHUB_TOKEN: ${{ github.token }} - NUGET_API_KEY: ${{ steps.nuget-creds.outputs.nuget_api_key }} - CHOCOLATEY_API_KEY: ${{ steps.choco-creds.outputs.choco_api_key }} + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Restore State + uses: ./.github/actions/cache-restore + + - uses: actions/download-artifact@v8 + name: Download nuget packages + with: + name: nuget + path: ${{ github.workspace }}/artifacts/packages/nuget + + - name: Load NuGet credentials + id: nuget-creds + if: inputs.publish_packages + uses: gittools/cicd/nuget-creds@v1 + with: + op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + + - name: Load Chocolatey credentials + id: choco-creds + if: inputs.publish_packages + uses: gittools/cicd/choco-creds@v1 + with: + op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + + - name: '[Publish]' + if: inputs.publish_packages + shell: pwsh + run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }} + env: + GITHUB_TOKEN: ${{ github.token }} + NUGET_API_KEY: ${{ steps.nuget-creds.outputs.nuget_api_key }} + CHOCOLATEY_API_KEY: ${{ steps.choco-creds.outputs.choco_api_key }} diff --git a/.github/workflows/_unit_tests.yml b/.github/workflows/_unit_tests.yml index 8af006dbd4..be5d056287 100644 --- a/.github/workflows/_unit_tests.yml +++ b/.github/workflows/_unit_tests.yml @@ -24,46 +24,40 @@ jobs: runs-on: ${{ matrix.os }} steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Restore State + uses: ./.github/actions/cache-restore - - - name: '[Unit Test]' - uses: nick-fields/retry@v3 - with: - shell: pwsh - timeout_minutes: 30 - max_attempts: 3 - retry_on: error - command: 'dotnet run/build.dll --target=UnitTest --dotnet_version=${{ matrix.dotnet_version }}' + - name: '[Unit Test]' + uses: nick-fields/retry@v3 + with: + shell: pwsh + timeout_minutes: 30 + max_attempts: 3 + retry_on: error + command: 'dotnet run/build.dll --target=UnitTest --dotnet_version=${{ matrix.dotnet_version }}' - - - name: Test Summary - uses: test-summary/action@v2.4 - if: always() && matrix.dotnet_version == '10.0' - with: - paths: artifacts/test-results/**/results.xml + - name: Test Summary + uses: test-summary/action@v2.4 + if: always() && matrix.dotnet_version == '10.0' + with: + paths: artifacts/test-results/**/results.xml - - - name: Upload Coverage - uses: codecov/codecov-action@v5 - if: success() && inputs.publish_coverage && matrix.dotnet_version == '10.0' - with: - files: artifacts/test-results/**/results.xml - report_type: 'test_results' - use_oidc: true + - name: Upload Coverage + uses: codecov/codecov-action@v5 + if: success() && inputs.publish_coverage && matrix.dotnet_version == '10.0' + with: + files: artifacts/test-results/**/results.xml + report_type: 'test_results' + use_oidc: true - - - name: Upload Coverage - uses: codecov/codecov-action@v5 - if: success() && inputs.publish_coverage && matrix.dotnet_version == '10.0' - with: - directory: artifacts/test-results - report_type: 'coverage' - use_oidc: true + - name: Upload Coverage + uses: codecov/codecov-action@v5 + if: success() && inputs.publish_coverage && matrix.dotnet_version == '10.0' + with: + directory: artifacts/test-results + report_type: 'coverage' + use_oidc: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 69a74c0e2e..944cca470c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -3,25 +3,25 @@ name: CodeQL on: push: branches: - - main - - 'support/*' - - 'next/*' + - main + - 'support/*' + - 'next/*' paths: - - '**' - - '!docs/**' - - '!.github/**' - - .github/workflows/codeql-analysis.yml + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/codeql-analysis.yml pull_request: branches: - - main - - 'support/*' - - 'next/*' + - main + - 'support/*' + - 'next/*' paths: - - '**' - - '!docs/**' - - '!.github/**' - - .github/workflows/codeql-analysis.yml + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/codeql-analysis.yml schedule: - cron: '0 12 * * *' @@ -49,40 +49,36 @@ jobs: language: [ 'csharp' ] steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 - - name: Initialize CodeQL - uses: github/codeql-action/init@v4 - with: - languages: ${{ matrix.language }} - tools: linked + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + tools: linked - - - name: Cache cake frosting - id: cache-cake - uses: actions/cache@v5 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + - name: Cache cake frosting + id: cache-cake + uses: actions/cache@v5 + with: + path: run + key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v5 - with: - global-json-file: global.json - - - name: '[Prepare]' - if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/ --configuration=Release + - name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json - - - name: '[Build]' - shell: pwsh - run: dotnet run/build.dll --target=BuildPrepare --exclusive + - name: '[Prepare]' + if: steps.cache-cake.outputs.cache-hit != 'true' + run: dotnet build build/ --configuration=Release - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v4 + - name: '[Build]' + shell: pwsh + run: dotnet run/build.dll --target=BuildPrepare --exclusive + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d4eb0f2716..503302df17 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,24 +6,24 @@ on: types: [ publish-release ] push: branches: - - main + - main paths: - - docs/** - - package*.json - - markdownlint.json - - .remarkrc.yaml - - mkdocs.yml - - .github/workflows/docs.yml + - docs/** + - package*.json + - markdownlint.json + - .remarkrc.yaml + - mkdocs.yml + - .github/workflows/docs.yml pull_request: branches: - - main + - main paths: - - docs/** - - package*.json - - markdownlint.json - - .remarkrc.yaml - - mkdocs.yml - - .github/workflows/docs.yml + - docs/** + - package*.json + - markdownlint.json + - .remarkrc.yaml + - mkdocs.yml + - .github/workflows/docs.yml env: DOTNET_ROLL_FORWARD: "Major" DOTNET_CLI_TELEMETRY_OPTOUT: 1 @@ -36,89 +36,87 @@ jobs: runs-on: ubuntu-24.04 steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Cache cake frosting - id: cache-cake - uses: actions/cache@v5 - with: - path: run - key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Use cached tools - id: cache-tools - uses: actions/cache@v5 - with: - path: tools - key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} - - - name: Get npm cache directory - shell: bash - id: cache-node-dir - run: | - cacheDir=$(npm config get cache) - echo "dir=$cacheDir" >> $GITHUB_OUTPUT - - - name: Cache Node Modules - id: cache-node - uses: actions/cache@v5 - with: - path: ${{ steps.cache-node-dir.outputs.dir }} - key: node-${{ runner.os }}-${{ hashFiles('./package-lock.json') }} - restore-keys: node-${{ runner.os }} - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v5 - with: - global-json-file: global.json - - - name: '[Build]' - if: steps.cache-cake.outputs.cache-hit != 'true' - run: dotnet build build/ --configuration=Release - - - name: '[Prepare]' - shell: pwsh - run: dotnet run/build.dll --target=BuildPrepare + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Cache cake frosting + id: cache-cake + uses: actions/cache@v5 + with: + path: run + key: run-${{ runner.os }}-${{ hashFiles('./build/**') }} + + - name: Use cached tools + id: cache-tools + uses: actions/cache@v5 + with: + path: tools + key: tools-${{ runner.os }}-${{ hashFiles('./build/**') }} + + - name: Get npm cache directory + shell: bash + id: cache-node-dir + run: | + cacheDir=$(npm config get cache) + echo "dir=$cacheDir" >> $GITHUB_OUTPUT + + - name: Cache Node Modules + id: cache-node + uses: actions/cache@v5 + with: + path: ${{ steps.cache-node-dir.outputs.dir }} + key: node-${{ runner.os }}-${{ hashFiles('./package-lock.json') }} + restore-keys: node-${{ runner.os }} + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json + + - name: '[Build]' + if: steps.cache-cake.outputs.cache-hit != 'true' + run: dotnet build build/ --configuration=Release + + - name: '[Prepare]' + shell: pwsh + run: dotnet run/build.dll --target=BuildPrepare validate: name: Validates Html needs: [ prepare ] runs-on: ubuntu-24.04 steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore - - - name: '[Build Documentation]' - shell: pwsh - run: dotnet run/docs.dll --target=BuildDocs - - - name: '[HTMLProofer]' - uses: chabad360/htmlproofer@master - with: - directory: ./artifacts/docs/preview - 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 - run: | - value=$([ ${{ github.event_name == 'pull_request' }} ] && echo "github-pr-review" || echo "github-check") - echo "value=$value" >> $GITHUB_OUTPUT - - - name: '[Remark Lint]' - uses: reviewdog/action-remark-lint@v5 - with: - github_token: ${{ github.token }} - reporter: ${{ steps.reporter.outputs.value }} + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Restore State + uses: ./.github/actions/cache-restore + + - name: '[Build Documentation]' + shell: pwsh + run: dotnet run/docs.dll --target=BuildDocs + + - name: '[HTMLProofer]' + uses: chabad360/htmlproofer@master + with: + directory: ./artifacts/docs/preview + 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 + run: | + value=$([ ${{ github.event_name == 'pull_request' }} ] && echo "github-pr-review" || echo "github-check") + echo "value=$value" >> $GITHUB_OUTPUT + + - name: '[Remark Lint]' + uses: reviewdog/action-remark-lint@v5 + with: + github_token: ${{ github.token }} + reporter: ${{ steps.reporter.outputs.value }} publish: if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' @@ -131,20 +129,19 @@ jobs: GITHUB_TOKEN: ${{ github.token }} GITHUB_USERNAME: ${{ github.actor }} steps: - - - name: Checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Restore State - uses: ./.github/actions/cache-restore - - - name: '[Build Schemas]' - shell: pwsh - run: dotnet run/docs.dll --target=GenerateSchemas - - - name: '[Publish Documentation]' - if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' - shell: pwsh - run: dotnet run/docs.dll --target=PublishDocs --force + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Restore State + uses: ./.github/actions/cache-restore + + - name: '[Build Schemas]' + shell: pwsh + run: dotnet run/docs.dll --target=GenerateSchemas + + - name: '[Publish Documentation]' + if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' + shell: pwsh + run: dotnet run/docs.dll --target=PublishDocs --force diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 390bd8adb3..be0be7f8d3 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -2,28 +2,28 @@ name: Code Format on: push: branches: - - main - - 'fix/*' - - 'feature/*' - - 'poc/*' - - 'support/*' - - 'next/*' + - main + - 'fix/*' + - 'feature/*' + - 'poc/*' + - 'support/*' + - 'next/*' paths: - - '**' - - '!docs/**' - - '!.github/**' - - .github/workflows/format.yml + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/format.yml pull_request: branches: - - main - - 'support/*' - - 'next/*' + - main + - 'support/*' + - 'next/*' paths: - - '**' - - '!docs/**' - - '!.github/**' - - .github/workflows/format.yml + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/format.yml permissions: contents: read @@ -39,17 +39,16 @@ jobs: runs-on: ubuntu-24.04 name: DotNet Format steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v6 - - - name: Setup .NET SDK + + - name: Setup .NET SDK uses: actions/setup-dotnet@v5 with: global-json-file: global.json - - - name: Run Format 'ci' solution + + - name: Run Format 'ci' solution run: dotnet format ./build/ --verify-no-changes - - - name: Run Format 'GitVersion' solution + + - name: Run Format 'GitVersion' solution run: dotnet format ./src/ --exclude **/AddFormats/ --verify-no-changes diff --git a/.github/workflows/gittools-actions.yml b/.github/workflows/gittools-actions.yml index 143dca7a4b..32e9a9bca8 100644 --- a/.github/workflows/gittools-actions.yml +++ b/.github/workflows/gittools-actions.yml @@ -23,8 +23,7 @@ jobs: name: Update GitTools Actions runs-on: ubuntu-24.04 steps: - - - name: Get version + - name: Get version id: get-version shell: pwsh run: | @@ -33,24 +32,24 @@ jobs: $version = "${{ github.event.inputs.tag-name }}" } "version=$version" >> $env:GITHUB_OUTPUT - - - name: Load GitHub App credentials - id: gh-app-creds - uses: gittools/cicd/gh-app-creds@v1 + + - name: Load GitHub App credentials + id: github-app-creds + uses: gittools/cicd/github-app-creds@v1 with: op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - - - name: Generate GitHub App Token + + - name: Generate GitHub App Token id: app-token uses: actions/create-github-app-token@v3 with: - app-id: ${{ steps.gh-app-creds.outputs.gh_app_id }} - private-key: ${{ steps.gh-app-creds.outputs.gh_app_private_key }} + app-id: ${{ steps.github-app-creds.outputs.gh_app_id }} + private-key: ${{ steps.github-app-creds.outputs.gh_app_private_key }} owner: ${{ github.repository_owner }} repositories: actions permission-contents: write - - - uses: peter-evans/repository-dispatch@v4 + + - uses: peter-evans/repository-dispatch@v4 name: Update GitTools Actions with: token: ${{ steps.app-token.outputs.token }} diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml index db169f2981..9d8137baf0 100644 --- a/.github/workflows/homebrew.yml +++ b/.github/workflows/homebrew.yml @@ -19,8 +19,7 @@ jobs: name: Bump Homebrew formula runs-on: macos-latest steps: - - - name: Get version + - name: Get version id: get-version shell: pwsh run: | @@ -29,34 +28,23 @@ jobs: $version = "${{ github.event.inputs.tag-name }}" } "version=$version" >> $env:GITHUB_OUTPUT - - - name: Load GitHub App credentials - id: gh-app-creds - uses: gittools/cicd/gh-app-creds@v1 + + - name: Load GitHub release token + id: github-creds + uses: gittools/cicd/github-creds@v1 with: op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - - - name: Generate GitHub App Token - id: app-token - uses: actions/create-github-app-token@v3 - with: - app-id: ${{ steps.gh-app-creds.outputs.gh_app_id }} - private-key: ${{ steps.gh-app-creds.outputs.gh_app_private_key }} - owner: ${{ github.repository_owner }} - repositories: homebrew-core - permission-contents: write - permission-pull-requests: write - - - uses: mislav/bump-homebrew-formula-action@v3 + + - uses: mislav/bump-homebrew-formula-action@v3 name: Bump Homebrew formula with: formula-name: gitversion tag-name: ${{ steps.get-version.outputs.version }} download-url: https://github.com/GitTools/GitVersion/archive/refs/tags/${{ steps.get-version.outputs.version }}.tar.gz - push-to: ${{ github.repository_owner }}/homebrew-core + push-to: gittools-bot/homebrew-core commit-message: | {{formulaName}} {{version}} For additional details see https://github.com/GitTools/GitVersion/releases/tag/${{ steps.get-version.outputs.version }} env: - COMMITTER_TOKEN: ${{ steps.app-token.outputs.token }} + COMMITTER_TOKEN: ${{ steps.github-creds.outputs.github_release_token }} diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index 5debdc1fcc..9193a80d08 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -1,5 +1,6 @@ name: Markdown Update on: + workflow_dispatch: push: paths: - 'docs/**' @@ -24,41 +25,27 @@ defaults: jobs: docs: - permissions: - contents: write name: Update Markdown (embedded snippets) runs-on: ubuntu-24.04 steps: - - - name: Checkout - uses: actions/checkout@v6 - if: github.event_name == 'push' - - - name: Checkout - uses: actions/checkout@v6 - if: github.event_name == 'pull_request' - - - name: Setup .NET SDK + - name: Checkout + uses: gittools/cicd/checkout@v1 + with: + op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + fetch-depth: 1 + + - name: Setup .NET SDK uses: actions/setup-dotnet@v5 with: global-json-file: global.json - - - name: Run MarkdownSnippets + + - 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 'gittools-bot' - git config user.email 'gittoolsbot@outlook.com' - git commit -m 'Docs changes' --allow-empty - git push --force - if: steps.status.outputs.has_changes == '1' && github.event_name == 'push' + + - name: Commit and push markdown docs changes + uses: gittools/cicd/git-commit-push@v1 + with: + message: "include markdown docs changes" diff --git a/.github/workflows/new-cli.yml b/.github/workflows/new-cli.yml index 2664bdbe51..3183ce0de0 100644 --- a/.github/workflows/new-cli.yml +++ b/.github/workflows/new-cli.yml @@ -2,28 +2,28 @@ name: Build (new-cli) on: push: branches: - - main - - 'fix/*' - - 'feature/*' - - 'poc/*' - - 'support/*' - - 'next/*' + - main + - 'fix/*' + - 'feature/*' + - 'poc/*' + - 'support/*' + - 'next/*' paths: - - '**' - - '!docs/**' - - '!.github/**' - - .github/workflows/new-cli.yml + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/new-cli.yml pull_request: branches: - - main - - 'support/*' - - 'next/*' + - main + - 'support/*' + - 'next/*' paths: - - '**' - - '!docs/**' - - '!.github/**' - - .github/workflows/new-cli.yml + - '**' + - '!docs/**' + - '!.github/**' + - .github/workflows/new-cli.yml permissions: contents: read @@ -40,20 +40,19 @@ jobs: runs-on: ubuntu-24.04 name: Build & Test (new-cli) steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v6 - - - name: Setup .NET SDK + + - name: Setup .NET SDK uses: actions/setup-dotnet@v5 with: global-json-file: global.json - - - name: Build 'new-cli' solution + + - name: Build 'new-cli' solution run: dotnet build ./new-cli - - - name: Run Format 'new-cli' solution + + - name: Run Format 'new-cli' solution run: dotnet format ./new-cli --exclude ~/.nuget/packages --verify-no-changes - - - name: Test 'new-cli' solution + + - name: Test 'new-cli' solution run: dotnet test --solution ./new-cli/GitVersion.slnx --no-build --verbosity normal diff --git a/.github/workflows/public-api.yml b/.github/workflows/public-api.yml index a20c502f54..4d8fdf640f 100644 --- a/.github/workflows/public-api.yml +++ b/.github/workflows/public-api.yml @@ -11,29 +11,19 @@ defaults: jobs: public-api: - permissions: - contents: write name: Mark public API as shipped runs-on: ubuntu-24.04 steps: - - - name: Checkout - uses: actions/checkout@v6 - if: github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' - - - name: Mark public API as shipped + - name: Checkout + uses: gittools/cicd/checkout@v1 + with: + op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + fetch-depth: 0 + + - name: Mark public API as shipped run: ./src/mark-shipped.ps1 - - - 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 'gittools-bot' - git config user.email 'gittoolsbot@outlook.com' - git commit -m 'Mark public API as shipped' --allow-empty - git push --force - if: steps.status.outputs.has_changes == '1' + + - name: Commit and push changes + uses: gittools/cicd/git-commit-push@v1 + with: + message: "include public API changes" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52d2f70d6f..6a9599e401 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,19 +10,18 @@ jobs: permissions: contents: write steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v6 - - - name: Get version + + - name: Get version id: get-version shell: pwsh run: | # Finding the version from release tag $TAG="${{ github.ref }}".Replace("refs/tags/", "") "tag=$TAG" >> $env:GITHUB_OUTPUT - - - uses: peter-evans/repository-dispatch@v4 + + - uses: peter-evans/repository-dispatch@v4 with: token: ${{ github.token }} repository: ${{ github.repository }} diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index d92f7f01ac..e6bea27abc 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -14,44 +14,34 @@ permissions: jobs: homebrew: - permissions: - contents: none name: Bump winget manifest runs-on: ubuntu-24.04 steps: - - name: Load GitHub App credentials - id: gh-app-creds - uses: gittools/cicd/gh-app-creds@v1 - with: - op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} - - name: Generate GitHub App Token - id: app-token - uses: actions/create-github-app-token@v3 - with: - app-id: ${{ steps.gh-app-creds.outputs.gh_app_id }} - private-key: ${{ steps.gh-app-creds.outputs.gh_app_private_key }} - owner: ${{ github.repository_owner }} - repositories: winget-pkgs - permission-contents: write - permission-pull-requests: write - - name: Get version - id: get-version - shell: pwsh - run: | - $version = "${{ github.event.client_payload.tag }}" - if ($version -eq "") { - $version = "${{ github.event.inputs.tag-name }}" - } + - name: Get version + id: get-version + shell: pwsh + run: | + $version = "${{ github.event.client_payload.tag }}" + if ($version -eq "") { + $version = "${{ github.event.inputs.tag-name }}" + } - $url = "https://github.com/GitTools/GitVersion/releases/download/{0}/gitversion-win-{1}-{0}.zip" - $urls = @(($url -f $version, "x64"), ($url -f $version, "arm64")) -Join " " + $url = "https://github.com/GitTools/GitVersion/releases/download/{0}/gitversion-win-{1}-{0}.zip" + $urls = @(($url -f $version, "x64"), ($url -f $version, "arm64")) -Join " " - $run_args = "update GitTools.GitVersion --version $version --urls $urls --submit" - "version=$version" >> $env:GITHUB_OUTPUT - "run_args=$run_args" >> $env:GITHUB_OUTPUT + $run_args = "update GitTools.GitVersion --version $version --urls $urls --submit" + "version=$version" >> $env:GITHUB_OUTPUT + "run_args=$run_args" >> $env:GITHUB_OUTPUT - - uses: michidk/run-komac@v2.1.0 - env: - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - with: - args: '${{ steps.get-version.outputs.run_args }}' + - name: Load GitHub release token + id: github-creds + uses: gittools/cicd/github-creds@v1 + with: + op_service_account_token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + + - uses: michidk/run-komac@v2.1.0 + env: + GITHUB_TOKEN: ${{ steps.github-creds.outputs.github_release_token }} + with: + args: '${{ steps.get-version.outputs.run_args }}' + custom-fork-owner: gittools-bot diff --git a/src/mark-shipped.ps1 b/src/mark-shipped.ps1 index 46940fea6c..21e3315194 100755 --- a/src/mark-shipped.ps1 +++ b/src/mark-shipped.ps1 @@ -7,30 +7,35 @@ Set-StrictMode -version 2.0 $ErrorActionPreference = "Stop" function MarkShipped([string]$dir) { + $nullableHeader = "#nullable enable"; $shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt" $shipped = @() $shipped += Get-Content $shippedFilePath $unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt" $unshipped = Get-Content $unshippedFilePath + $added = @() $removed = @() $removedPrefix = "*REMOVED*"; - Write-Host "Processing $dir" foreach ($item in $unshipped) { - if ($item.Length -gt 0) { + if ($item.Length -gt 0 -and $item -ne $nullableHeader) { if ( $item.StartsWith($removedPrefix)) { $item = $item.Substring($removedPrefix.Length) $removed += $item } else { $shipped += $item + $added += $item } } } + $changeCount = $added.Count + $removed.Count + Write-Host ("{0,-6} Processed {1}" -f "[$changeCount]", $unshippedFilePath) + $shipped | Sort-Object -Unique | Where-Object { -not $removed.Contains($_) } | Out-File $shippedFilePath -Encoding Ascii - "#nullable enable" | Out-File $unshippedFilePath -Encoding Ascii + $nullableHeader | Out-File $unshippedFilePath -Encoding Ascii } try { @@ -38,6 +43,9 @@ try { $dir = Split-Path -parent $file MarkShipped $dir } + if ($null -ne (git status --porcelain)) { + Write-Host "Changes detected, committing and pushing changes" + } } catch { Write-Host $_