From a965d8940ffd328af40ff4db48ec29c726913b91 Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Fri, 3 Jul 2026 13:34:43 +0900 Subject: [PATCH 1/3] refactor(ci): use temp dir --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 30cc9036..94090cf4 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -10,7 +10,7 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_NOLOGO: true NUGET_XMLDOC_MODE: skip - NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages + NUGET_PACKAGES: ${{ runner.temp }}/.nuget/packages jobs: lint: From bc0ce5de82bda71d2d8ee29fd55bd81eadd9167d Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:54:46 +0900 Subject: [PATCH 2/3] refactor(ci): use parallel on Lint job --- .github/workflows/dotnet.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 94090cf4..b876b181 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -10,7 +10,7 @@ env: DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_NOLOGO: true NUGET_XMLDOC_MODE: skip - NUGET_PACKAGES: ${{ runner.temp }}/.nuget/packages + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages jobs: lint: @@ -25,13 +25,13 @@ jobs: - name: Restore .NET tools run: dotnet tool restore - - name: Lint with dotnet-format - run: | - dotnet format style --verify-no-changes --verbosity detailed - dotnet format analyzers --verify-no-changes --verbosity detailed - - - name: Format Check with csharpier - run: dotnet csharpier check . --log-format msbuild + - parallel: + - name: Lint with dotnet-format (style) + run: dotnet format style --verify-no-changes --verbosity detailed + - name: Lint with dotnet-format (analyzers) + run: dotnet format analyzers --verify-no-changes --verbosity detailed + - name: Format Check with csharpier + run: dotnet csharpier check . --log-format msbuild test: name: Debug Build & Test From 2bce43b991e0c5cc34fdc4de621471819155c98e Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Fri, 3 Jul 2026 21:00:52 +0900 Subject: [PATCH 3/3] refactor(ci): avoid use variable & use parallel --- .github/workflows/copilot-setup-steps.yml | 9 +++++- .github/workflows/dotnet.yml | 15 +++++---- .github/workflows/release.yml | 37 ++++++++++++----------- 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 12b04d88..5cd8cddf 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -19,15 +19,22 @@ env: jobs: copilot-setup-steps: runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@v7.0.0 - name: Setup .NET SDK uses: actions/setup-dotnet@v5.4.0 with: - dotnet-version: ${{ vars.DOTNET_SDK_VERSIONS }} + dotnet-version: | + 10.x + 9.x + 8.x cache: true cache-dependency-path: Directory.Packages.props + - name: Restore .NET tools + run: dotnet tool restore - name: Restore NuGet packages run: dotnet restore diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b876b181..05e5f75a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,7 +20,7 @@ jobs: contents: read steps: - uses: actions/checkout@v7.0.0 - - name: Setup .NET SDK # detected from global.json + - name: Setup .NET SDK # detect version from global.json uses: actions/setup-dotnet@v5.4.0 - name: Restore .NET tools run: dotnet tool restore @@ -57,14 +57,17 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v5.4.0 with: - dotnet-version: ${{ vars.DOTNET_SDK_VERSIONS }} + dotnet-version: | + 10.x + 9.x + 8.x cache: true cache-dependency-path: Directory.Packages.props - name: Build run: dotnet build - name: Test - run: dotnet test --no-build --coverage --coverage-output-format cobertura --coverage-output "${{ vars.COVERAGE_REPORT_FILE }}" + run: dotnet test --no-build --coverage --coverage-output-format cobertura --coverage-output "coverage.cobertura.xml" - name: Upload coverage to Codecov uses: codecov/codecov-action@v7.0.0 @@ -74,6 +77,6 @@ jobs: flags: ${{ runner.os }},${{ runner.arch }} disable_search: true files: | - ${{ format(vars.TEST_ASSET_FOLDERS, 'net10.0', vars.COVERAGE_REPORT_FILE) }}, - ${{ format(vars.TEST_ASSET_FOLDERS, 'net9.0', vars.COVERAGE_REPORT_FILE) }}, - ${{ format(vars.TEST_ASSET_FOLDERS, 'net8.0', vars.COVERAGE_REPORT_FILE) }} + ${{ format(vars.TEST_ASSET_FOLDERS, 'net10.0', 'coverage.cobertura.xml') }}, + ${{ format(vars.TEST_ASSET_FOLDERS, 'net9.0', 'coverage.cobertura.xml') }}, + ${{ format(vars.TEST_ASSET_FOLDERS, 'net8.0', 'coverage.cobertura.xml') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 495fd5bf..95f26317 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,33 +25,34 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v5.4.0 with: - dotnet-version: ${{ vars.DOTNET_SDK_VERSIONS }} + dotnet-version: | + 10.x + 9.x + 8.x cache: true cache-dependency-path: Directory.Packages.props - name: Login to NuGet (with OIDC) - uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 #v1.2.0 + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 id: login with: user: ${{ vars.NUGET_USER_NAME }} - - name: Restore - run: dotnet restore --locked-mode - name: Release Build & Pack - run: dotnet pack --configuration Release --no-restore --output nupkgs -p:Version=${TAG_VERSION:1} + run: dotnet pack --configuration Release --output nupkgs -p:Version=${TAG_VERSION:1} env: TAG_VERSION: ${{ github.event.release.tag_name }} # v0.0.0-abc - - name: Generate Attestation for packages - uses: actions/attest@v4.1.1 - with: - subject-path: "nupkgs/*.nupkg" - - - name: Publish to NuGet - run: dotnet nuget push "nupkgs/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }} - - name: Upload Packages - uses: actions/upload-artifact@v7.0.1 - with: - name: packages - path: nupkgs/ - include-hidden-files: true + - parallel: + - name: Generate Attestation for packages + uses: actions/attest@v4.1.1 + with: + subject-path: "nupkgs/*.nupkg" + - name: Publish to NuGet + run: dotnet nuget push "nupkgs/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ steps.login.outputs.NUGET_API_KEY }} + - name: Upload Packages + uses: actions/upload-artifact@v7.0.1 + with: + name: packages + path: nupkgs/ + include-hidden-files: true