diff --git a/.github/workflows/relase.yml b/.github/workflows/relase.yml deleted file mode 100644 index 7686f1a..0000000 --- a/.github/workflows/relase.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Release to NuGet - -on: - release: - types: [published] - -jobs: - build: - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Setup dotnet - uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a #v3.0.3 - - name: Build - run: dotnet build -c Release - - name: Test - run: dotnet test -c Release --no-build - - name: Pack nugets - run: dotnet pack -c Release --no-build --output . - - name: Push to NuGet - run: dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b985424 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release to NuGet + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + + - name: Setup dotnet + uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 + + - name: Build + run: dotnet build --configuration Release + + - name: Test + run: > + dotnet test + --no-build + --framework net462 + --configuration Release + --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" + -- + RunConfiguration.CollectSourceInformation=true + + - name: Pack nugets + run: > + dotnet pack + --configuration Release + --no-build + --output . + + - name: Push to NuGet + run: > + dotnet nuget push *.nupkg + --source https://api.nuget.org/v3/index.json + --api-key ${{secrets.nuget_api_key}} diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7d60b99..3614527 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -22,11 +22,14 @@ jobs: clean_name: ${{steps.clean_branch_name.outputs.CLEAN_BRANCH_NAME}} steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - name: Checkout + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - name: Setup dotnet - uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a #v3.0.3 + uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3 # with: # dotnet-version: ${{ matrix.dotnet-version }} + # You can test your matrix by printing the current dotnet version - name: Display dotnet version run: dotnet --version @@ -35,13 +38,26 @@ jobs: run: dotnet restore --locked-mode - name: Build - run: dotnet build -f net6.0 --verbosity minimal --no-restore + run: > + dotnet build + --no-restore + --framework net6.0 + --configuration Release + --verbosity minimal - name: Check Format run: dotnet format --verify-no-changes --no-restore - name: Test with the dotnet CLI - run: dotnet test --no-build --no-restore --framework net6.0 --logger "trx;LogFileName=pw-test-results.trx" + run: > + dotnet test + --no-build + --no-restore + --framework net6.0 + --configuration Release + --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" + -- + RunConfiguration.CollectSourceInformation=true - id: clean_branch_name name: Clean Branch Name @@ -49,22 +65,16 @@ jobs: env: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - - name: Report test results - uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6.0 - if: always() - with: - name: Test Results - path: "**/*-test-results.trx" - reporter: dotnet-trx - fail-on-error: true - build-framework: runs-on: windows-latest needs: build-dotnet steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - name: Checkout + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + # - name: Setup dotnet # uses: setup msbuild? + - name: Display dotnet version run: | dotnet --version @@ -75,29 +85,39 @@ jobs: - name: Build # Don't specify a framework here so we build both .NET and .NET Framework so we can pack both - run: dotnet build --verbosity minimal --no-restore + run: > + dotnet build + --no-restore + --configuration Release + --verbosity minimal # Don't bother running formatting for this build - name: Test with the dotnet CLI # We will have already ran the tests on ubuntu, so only do .NET Framework ones here - run: dotnet test --no-build --no-restore --framework net462 --logger "trx;LogFileName=pw-framework-test-results.trx" - - - name: Report test results - uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6.0 - if: always() - with: - name: Test Results - path: "**/*-test-results.trx" - reporter: dotnet-trx - fail-on-error: true + run: > + dotnet test + --no-build + --no-restore + --framework net462 + --configuration Release + --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" + -- + RunConfiguration.CollectSourceInformation=true - name: Pack NuGet Packages - run: dotnet pack --no-build --version-suffix "ci-${{ env.CLEAN_BRANCH_NAME }}-${{ github.run_id }}" + run: > + dotnet pack + --no-build + --configuration Release + --version-suffix "ci-${{ env.CLEAN_BRANCH_NAME }}-${{ github.run_id }}" env: CLEAN_BRANCH_NAME: ${{needs.build-dotnet.outputs.clean_name}} - name: Publish NuGet Packages - run: dotnet nuget push **/*.nupkg --source https://nuget.pkg.github.com/passwordless/index.json --api-key ${{env.GITHUB_TOKEN}} + run: > + dotnet nuget push **/*.nupkg + --source https://nuget.pkg.github.com/passwordless/index.json + --api-key ${{env.GITHUB_TOKEN}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/Sdk.Tests/Sdk.Tests.csproj b/tests/Sdk.Tests/Sdk.Tests.csproj index 6ae067c..e62fda2 100644 --- a/tests/Sdk.Tests/Sdk.Tests.csproj +++ b/tests/Sdk.Tests/Sdk.Tests.csproj @@ -11,17 +11,12 @@ + - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - + +