diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml index c9ecfeeaf..48f71d24a 100644 --- a/.github/workflows/commands-handler.yml +++ b/.github/workflows/commands-handler.yml @@ -11,11 +11,12 @@ jobs: process: name: Process command if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true - runs-on: ubuntu-latest + runs-on: + group: Default steps: - name: Check referred user id: user-check - env: + env: CLEN_BOT: ${{ secrets.CLEN_BOT }} run: echo "expected-user=${{ startsWith(github.event.comment.body, format('@{0} ', env.CLEN_BOT)) }}" >> $GITHUB_OUTPUT - name: Regular comment @@ -23,12 +24,12 @@ jobs: run: echo -e "\033[38;2;19;181;255mThis is regular commit which should be ignored.\033[0m" - name: Checkout repository if: steps.user-check.outputs.expected-user == 'true' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - token: ${{ secrets.GH_TOKEN }} + token: ${{ secrets.GH_TOKEN }} - name: Checkout release actions if: steps.user-check.outputs.expected-user == 'true' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31b715108..0d28338e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,20 +2,20 @@ name: Automated product release on: pull_request: - branches: [ master ] - types: [ closed ] - + branches: [master] + types: [closed] jobs: check-release: name: Check release required - runs-on: ubuntu-latest if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true + runs-on: + group: Default outputs: release: ${{ steps.check.outputs.ready }} steps: - name: Checkout actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -28,24 +28,25 @@ jobs: token: ${{ secrets.GH_TOKEN }} publish-nuget: name: Publish to NuGet - runs-on: windows-2019 needs: check-release if: needs.check-release.outputs.release == 'true' + runs-on: + group: windows-gh defaults: run: shell: powershell steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # This should be the same as the one specified for on.pull_request.branches ref: master - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.0.3 - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: - dotnet-version: | + dotnet-version: | 2.1.519 5.0.x 6.0.x @@ -59,30 +60,31 @@ jobs: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} run: .\\.github\\workflows\\release\\publish-packages.ps1 - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: nuget-packages path: ${{ github.workspace }}\.github\.release\artifacts\*.nupkg retention-days: 1 publish: name: Publish package - runs-on: ubuntu-latest needs: publish-nuget + runs-on: + group: Default steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # This should be the same as the one specified for on.pull_request.branches ref: master - name: Checkout actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 token: ${{ secrets.GH_TOKEN }} path: .github/.release/actions - name: Download artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: nuget-packages path: ${{ github.workspace }}/.github/.release/artifacts diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 39686d8b3..82d6f87ab 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -10,15 +10,16 @@ concurrency: jobs: tests: name: Integration and Unit tests - runs-on: windows-2019 + runs-on: + group: windows-gh defaults: run: shell: powershell steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Checkout actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -27,9 +28,10 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1 - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | + 3.x 5.0.x 6.0.x 7.0.x @@ -38,26 +40,27 @@ jobs: WORKSPACE_PATH: ${{ github.workspace }} run: .\\.github\\workflows\\release\\build-packages.ps1 # - name: Run unit tests - # env: + # env: # PN_PUB_KEY: ${{ secrets.PN_PUB_KEY }} # PN_SUB_KEY: ${{ secrets.PN_SUB_KEY }} - # PN_SEC_KEY: ${{ secrets.PN_SEC_KEY }} - # run: dotnet test .\\src\\UnitTests\\PubnubApiPCL.Tests\\PubnubApiPCL.Tests.csproj --verbosity normal --logger trx + # PN_SEC_KEY: ${{ secrets.PN_SEC_KEY }} + # run: dotnet test .\\src\\UnitTests\\PubnubApiPCL.Tests\\PubnubApiPCL.Tests.csproj --verbosity normal --logger trx - name: Cancel workflow runs for commit on error if: failure() uses: ./.github/.release/actions/actions/utils/fast-jobs-failure acceptance-tests: name: Acceptance tests - runs-on: windows-2019 + runs-on: + group: windows-gh defaults: run: shell: powershell working-directory: ./src steps: - name: Checkout Project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout mock-server action - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -68,7 +71,7 @@ jobs: with: token: ${{ secrets.GH_TOKEN }} - name: Setup .NET 6.0.x - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: dotnet-version: 6.0.x - name: Restore dependencies @@ -78,20 +81,20 @@ jobs: cd ./UnitTests/AcceptanceTests dotnet build --no-restore - name: Run acceptance tests - env: + env: PN_PAM_PUB_KEY: ${{ secrets.SDK_PAM_PUB_KEY }} PN_PAM_SUB_KEY: ${{ secrets.SDK_PAM_SUB_KEY }} - PN_PAM_SEC_KEY: ${{ secrets.SDK_PAM_SEC_KEY }} + PN_PAM_SEC_KEY: ${{ secrets.SDK_PAM_SEC_KEY }} PN_PUB_KEY: ${{ secrets.SDK_PUB_KEY }} PN_SUB_KEY: ${{ secrets.SDK_SUB_KEY }} - PN_SEC_KEY: ${{ secrets.SDK_SEC_KEY }} + PN_SEC_KEY: ${{ secrets.SDK_SEC_KEY }} run: | Copy-Item -Path "${{ github.workspace }}/sdk-specifications/features/access/*" -Destination "${{ github.workspace }}/src/UnitTests/AcceptanceTests/Features" -Recurse cd ./UnitTests/AcceptanceTests dotnet test --no-build --verbosity normal --logger trx --results-directory ./results - name: Upload acceptance tests reports if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: acceptance-test-reports path: | @@ -102,8 +105,9 @@ jobs: uses: ./.github/.release/actions/actions/utils/fast-jobs-failure all-tests: name: Tests - runs-on: ubuntu-latest needs: [tests, acceptance-tests] + runs-on: + group: Default steps: - name: Tests summary run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index f81992ba9..929f49cc3 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -10,12 +10,13 @@ concurrency: jobs: pubnub-yml: name: "Validate .pubnub.yml" - runs-on: ubuntu-latest + runs-on: + group: Default steps: - name: Checkout project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout validator action - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -30,8 +31,9 @@ jobs: uses: ./.github/.release/actions/actions/utils/fast-jobs-failure all-validations: name: Validations - runs-on: ubuntu-latest needs: [pubnub-yml] + runs-on: + group: Default steps: - name: Validations summary - run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed" \ No newline at end of file + run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed" diff --git a/src/Api/PubnubApi/PubnubApi.csproj b/src/Api/PubnubApi/PubnubApi.csproj index 30299f97c..4ac474b47 100644 --- a/src/Api/PubnubApi/PubnubApi.csproj +++ b/src/Api/PubnubApi/PubnubApi.csproj @@ -30,10 +30,11 @@ false + $(DefineConstants);NET40