From 2bcef97b3385f87ca92fa584308ad4ba78eac376 Mon Sep 17 00:00:00 2001 From: Dwi Cahya Pramanda Date: Wed, 23 Oct 2024 06:11:42 +0700 Subject: [PATCH 1/4] TEST: remove true from no-symbols and retry pre-release --- .github/workflows/pull_request.yml | 48 ++++++++++++------- .../Extensions/IMvcBuilderExtensions.cs | 2 +- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a274fec..04eeb11 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Build version suffix - run: echo "VERSION_SUFFIX=alpha.${{ github.run_number }}" >> $GITHUB_ENV + run: echo "VERSION_SUFFIX=beta.${{ github.run_number }}" >> $GITHUB_ENV - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -33,25 +33,39 @@ jobs: with: path: ./artifacts/* - codecoverage_report: - runs-on: ubuntu-latest + - name: Publish to GPR + run: | + dotnet nuget push "./artifacts/*.nupkg" \ + --no-symbols \ + --api-key ${{ secrets.GITHUB_TOKEN }} \ + --source https://nuget.pkg.github.com/${{ github.repository_owner }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 + - name: Remove old pre-release packages (keeping the GPR cleanish) + uses: actions/delete-package-versions@v5 + with: + package-name: 'Homely.AspNetCore.Mvc.Helpers' + min-versions-to-keep: 10 + delete-only-pre-release-versions: "true" - - name: Setup .NET - uses: actions/setup-dotnet@v4 + # codecoverage_report: + # runs-on: ubuntu-latest - - run: dotnet restore --verbosity minimal + # steps: + # - name: Checkout repo + # uses: actions/checkout@v4 - - run: dotnet build --configuration Debug + # - name: Setup .NET + # uses: actions/setup-dotnet@v4 - - run: dotnet test --configuration Debug --verbosity minimal --no-build --collect:"XPlat Code Coverage" --results-directory "./.codecoverage" + # - run: dotnet restore --verbosity minimal - - name: Code coverage - uses: codecov/codecov-action@v4 - with: - token: "${{ secrets.CODECOV_TOKEN }}" - directory: "./.codecoverage" - fail_ci_if_error: true + # - run: dotnet build --configuration Debug + + # - run: dotnet test --configuration Debug --verbosity minimal --no-build --collect:"XPlat Code Coverage" --results-directory "./.codecoverage" + + # - name: Code coverage + # uses: codecov/codecov-action@v4 + # with: + # token: "${{ secrets.CODECOV_TOKEN }}" + # directory: "./.codecoverage" + # fail_ci_if_error: true diff --git a/src/Homely.AspNetCore.Mvc.Helpers/Extensions/IMvcBuilderExtensions.cs b/src/Homely.AspNetCore.Mvc.Helpers/Extensions/IMvcBuilderExtensions.cs index f342764..102a6d9 100644 --- a/src/Homely.AspNetCore.Mvc.Helpers/Extensions/IMvcBuilderExtensions.cs +++ b/src/Homely.AspNetCore.Mvc.Helpers/Extensions/IMvcBuilderExtensions.cs @@ -26,7 +26,7 @@ public static IMvcBuilder AddAHomeController(this IMvcBuilder builder, string? asciiBanner = null, Assembly? callingAssembly = null) { - if (callingAssembly == null) + if (callingAssembly == null) { callingAssembly = Assembly.GetExecutingAssembly(); } From 83d8ad116df7a9e45963a0a5a6e2b9527c56c9c7 Mon Sep 17 00:00:00 2001 From: Dwi Cahya Pramanda Date: Wed, 23 Oct 2024 06:15:05 +0700 Subject: [PATCH 2/4] TEST: add permission --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 04eeb11..36e3593 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,6 +2,9 @@ name: 1. Pull Requests on: pull_request +permissions: + packages: write + env: DOTNET_NOLOGO: true From e8f03dcf586fe7a8c3bb0c5e4ea2bcd68f30dd23 Mon Sep 17 00:00:00 2001 From: Dwi Cahya Pramanda Date: Wed, 23 Oct 2024 06:19:37 +0700 Subject: [PATCH 3/4] TEST: move permission --- .github/workflows/pull_request.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 36e3593..96e3aef 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,9 +2,6 @@ name: 1. Pull Requests on: pull_request -permissions: - packages: write - env: DOTNET_NOLOGO: true @@ -12,7 +9,8 @@ jobs: build_nuget: runs-on: ubuntu-latest - + permissions: + packages: write steps: - name: Checkout repository uses: actions/checkout@v4 From 484e566bfda643aec018c53417f843b5bc4cb114 Mon Sep 17 00:00:00 2001 From: Dwi Cahya Pramanda Date: Wed, 23 Oct 2024 06:32:15 +0700 Subject: [PATCH 4/4] Remove --no-symbols option as it's no longer working on NET 8 Rollback pull_request --- .github/workflows/ci.yml | 1 - .github/workflows/pull_request.yml | 51 +++++++++++------------------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5505eb..c1c542a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,6 @@ jobs: - name: Publish to GPR run: | dotnet nuget push "./artifacts/*.nupkg" \ - --no-symbols true \ --api-key ${{ secrets.GITHUB_TOKEN }} \ --source https://nuget.pkg.github.com/${{ github.repository_owner }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 96e3aef..caaefd5 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,14 +9,13 @@ jobs: build_nuget: runs-on: ubuntu-latest - permissions: - packages: write + steps: - name: Checkout repository uses: actions/checkout@v4 - name: Build version suffix - run: echo "VERSION_SUFFIX=beta.${{ github.run_number }}" >> $GITHUB_ENV + run: echo "VERSION_SUFFIX=alpha.${{ github.run_number }}" >> $GITHUB_ENV - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -34,39 +33,25 @@ jobs: with: path: ./artifacts/* - - name: Publish to GPR - run: | - dotnet nuget push "./artifacts/*.nupkg" \ - --no-symbols \ - --api-key ${{ secrets.GITHUB_TOKEN }} \ - --source https://nuget.pkg.github.com/${{ github.repository_owner }} - - - name: Remove old pre-release packages (keeping the GPR cleanish) - uses: actions/delete-package-versions@v5 - with: - package-name: 'Homely.AspNetCore.Mvc.Helpers' - min-versions-to-keep: 10 - delete-only-pre-release-versions: "true" - - # codecoverage_report: - # runs-on: ubuntu-latest + codecoverage_report: + runs-on: ubuntu-latest - # steps: - # - name: Checkout repo - # uses: actions/checkout@v4 + steps: + - name: Checkout repo + uses: actions/checkout@v4 - # - name: Setup .NET - # uses: actions/setup-dotnet@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 - # - run: dotnet restore --verbosity minimal + - run: dotnet restore --verbosity minimal - # - run: dotnet build --configuration Debug + - run: dotnet build --configuration Debug - # - run: dotnet test --configuration Debug --verbosity minimal --no-build --collect:"XPlat Code Coverage" --results-directory "./.codecoverage" + - run: dotnet test --configuration Debug --verbosity minimal --no-build --collect:"XPlat Code Coverage" --results-directory "./.codecoverage" - # - name: Code coverage - # uses: codecov/codecov-action@v4 - # with: - # token: "${{ secrets.CODECOV_TOKEN }}" - # directory: "./.codecoverage" - # fail_ci_if_error: true + - name: Code coverage + uses: codecov/codecov-action@v4 + with: + token: "${{ secrets.CODECOV_TOKEN }}" + directory: "./.codecoverage" + fail_ci_if_error: true \ No newline at end of file