diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index be48ff0..b384261 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -5,7 +5,7 @@ env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_ENVIRONMENT: github ASPNETCORE_ENVIRONMENT: github - BUILD_PATH: '${{github.workspace}}/artifacts' + BUILD_PATH: "${{github.workspace}}/artifacts" COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} on: @@ -14,14 +14,13 @@ on: - main - develop tags: - - 'v*' + - "v*" pull_request: branches: - main - develop jobs: - build: runs-on: ubuntu-latest @@ -36,45 +35,45 @@ jobs: - azurite_data:/data mcr.microsoft.com/azure-storage/azurite steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install .NET Core - uses: actions/setup-dotnet@v4 - with: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install .NET Core + uses: actions/setup-dotnet@v4 + with: dotnet-version: | - 6.0.x - 7.0.x - 8.0.x + 6.0.x + 7.0.x + 8.0.x - - name: Restore Dependencies - run: dotnet restore + - name: Restore Dependencies + run: dotnet restore - - name: Build Solution - run: dotnet build --no-restore --configuration Release + - name: Build Solution + run: dotnet build --no-restore --configuration Release - - name: Run Test - run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings + - name: Run Test + run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings - - name: Report Coverage - if: success() - uses: coverallsapp/github-action@v2 - with: - file: '${{github.workspace}}/test/*/TestResults/*/coverage.info' - format: lcov + - name: Report Coverage + if: success() + uses: coverallsapp/github-action@v2 + with: + file: "${{github.workspace}}/test/*/TestResults/*/coverage.info" + format: lcov - - name: Create Packages - if: success() && github.event_name != 'pull_request' - run: dotnet pack --configuration Release --include-symbols --include-source --no-build --output "${{env.BUILD_PATH}}" + - name: Create Packages + if: success() && github.event_name != 'pull_request' + run: dotnet pack --configuration Release --include-symbols --include-source --no-build --output "${{env.BUILD_PATH}}" - - name: Upload Packages - if: success() && github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 - with: - name: packages - path: '${{env.BUILD_PATH}}' + - name: Upload Packages + if: success() && github.event_name != 'pull_request' + uses: actions/upload-artifact@v4 + with: + name: packages + path: "${{env.BUILD_PATH}}" deploy: runs-on: ubuntu-latest @@ -82,29 +81,29 @@ jobs: if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) steps: - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: packages - - - name: Publish Packages GitHub - run: | - for package in $(find -name "*.nupkg"); do - echo "${0##*/}": Pushing $package... - dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate - done - - - name: Publish Packages feedz - run: | - for package in $(find -name "*.nupkg"); do - echo "${0##*/}": Pushing $package... - dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate - done - - - name: Publish Packages Nuget - if: startsWith(github.ref, 'refs/tags/v') - run: | - for package in $(find -name "*.nupkg"); do - echo "${0##*/}": Pushing $package... - dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate - done + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: packages + + - name: Publish Packages GitHub + run: | + for package in $(find -name "*.nupkg"); do + echo "${0##*/}": Pushing $package... + dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate + done + + - name: Publish Packages feedz + run: | + for package in $(find -name "*.nupkg"); do + echo "${0##*/}": Pushing $package... + dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate + done + + - name: Publish Packages Nuget + if: startsWith(github.ref, 'refs/tags/v') + run: | + for package in $(find -name "*.nupkg"); do + echo "${0##*/}": Pushing $package... + dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate + done