From 01952eca623b4ad0216c1eb4fbbbd3a6ae5e4975 Mon Sep 17 00:00:00 2001 From: "PUBNUB\\jakub.grzesiowski" Date: Tue, 21 Jan 2025 14:26:56 +0100 Subject: [PATCH] Add .github with CI files --- unity-chat/.github/CODEOWNERS | 2 + .../.github/workflows/commands-handler.yml | 44 ++++++ unity-chat/.github/workflows/release.yml | 54 +++++++ .../.github/workflows/release/versions.json | 25 ++++ unity-chat/.github/workflows/run-tests.yml | 48 ++++++ .../.github/workflows/run-validations.yml | 42 ++++++ unity-chat/.pubnub.yml | 138 ++++++++++++++++++ 7 files changed, 353 insertions(+) create mode 100644 unity-chat/.github/CODEOWNERS create mode 100644 unity-chat/.github/workflows/commands-handler.yml create mode 100644 unity-chat/.github/workflows/release.yml create mode 100644 unity-chat/.github/workflows/release/versions.json create mode 100644 unity-chat/.github/workflows/run-tests.yml create mode 100644 unity-chat/.github/workflows/run-validations.yml create mode 100644 unity-chat/.pubnub.yml diff --git a/unity-chat/.github/CODEOWNERS b/unity-chat/.github/CODEOWNERS new file mode 100644 index 0000000..5e00c41 --- /dev/null +++ b/unity-chat/.github/CODEOWNERS @@ -0,0 +1,2 @@ +* @xavrax @jakub-grzesiowski @parfeon +README.md @techwritermat @xavrax @jakub-grzesiowski @parfeon diff --git a/unity-chat/.github/workflows/commands-handler.yml b/unity-chat/.github/workflows/commands-handler.yml new file mode 100644 index 0000000..51f8668 --- /dev/null +++ b/unity-chat/.github/workflows/commands-handler.yml @@ -0,0 +1,44 @@ +name: Commands processor + +on: + issue_comment: + types: [created] +defaults: + run: + shell: bash + +jobs: + process: + name: Process command + if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true + runs-on: + group: organization/Default + steps: + - name: Check referred user + id: user-check + 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 + if: steps.user-check.outputs.expected-user != 'true' + 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@v4 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Checkout release actions + if: steps.user-check.outputs.expected-user == 'true' + uses: actions/checkout@v4 + with: + repository: pubnub/client-engineering-deployment-tools + ref: v1 + token: ${{ secrets.GH_TOKEN }} + path: .github/.release/actions + - name: Process changelog entries + if: steps.user-check.outputs.expected-user == 'true' + uses: ./.github/.release/actions/actions/commands + with: + token: ${{ secrets.GH_TOKEN }} + listener: ${{ secrets.CLEN_BOT }} + jira-api-key: ${{ secrets.JIRA_API_KEY }} diff --git a/unity-chat/.github/workflows/release.yml b/unity-chat/.github/workflows/release.yml new file mode 100644 index 0000000..e8843a0 --- /dev/null +++ b/unity-chat/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: Automated product release + +on: + pull_request: + branches: [master] + types: [closed] +concurrency: unity_run + +jobs: + check-release: + name: Check release required + if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true + runs-on: + group: organization/Default + outputs: + release: ${{ steps.check.outputs.ready }} + steps: + - name: Checkout actions + uses: actions/checkout@v4 + with: + repository: pubnub/client-engineering-deployment-tools + ref: v1 + token: ${{ secrets.GH_TOKEN }} + path: .github/.release/actions + - id: check + name: Check pre-release completed + uses: ./.github/.release/actions/actions/checks/release + with: + token: ${{ secrets.GH_TOKEN }} + publish: + name: Build package + runs-on: + group: organization/macos-gh + needs: check-release + if: needs.check-release.outputs.release == 'true' + steps: + - name: Checkout repository + 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@v4 + with: + repository: pubnub/client-engineering-deployment-tools + ref: v1 + token: ${{ secrets.GH_TOKEN }} + path: .github/.release/actions + - name: Create Release + uses: ./.github/.release/actions/actions/services/github-release + with: + token: ${{ secrets.GH_TOKEN }} + jira-api-key: ${{ secrets.JIRA_API_KEY }} + last-service: true diff --git a/unity-chat/.github/workflows/release/versions.json b/unity-chat/.github/workflows/release/versions.json new file mode 100644 index 0000000..a4e68f3 --- /dev/null +++ b/unity-chat/.github/workflows/release/versions.json @@ -0,0 +1,25 @@ +{ + ".pubnub.yml": [ + { "pattern": "^version: (v?(\\.?\\d+){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)$", "cleared": false }, + { + "pattern": "\/releases\/download\/(v?(\\.?\\d+){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\/PubNub\\.unitypackage$", + "cleared": false + } + ], + "VERSION": [ + { "pattern": "(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)", "cleared": true } + ], + "README.md": [ + { + "pattern": "\/releases\/download\/(v?(\\.?\\d+){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\/PubNub\\.unitypackage\\)\\.$", + "cleared": false + } + ], + "PubnubChatUnity/Assets/PubnubChat/package.json": [ + { + "pattern": "^\\s{2,}\"version\": \"(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\",$", + "clearedPrefix": true, + "clearedSuffix": false + } + ] +} diff --git a/unity-chat/.github/workflows/run-tests.yml b/unity-chat/.github/workflows/run-tests.yml new file mode 100644 index 0000000..33086ff --- /dev/null +++ b/unity-chat/.github/workflows/run-tests.yml @@ -0,0 +1,48 @@ +name: Tests + +on: + push: + workflow_dispatch: +concurrency: unity_run +defaults: + run: + shell: bash + +jobs: + tests: + name: Integration and Unit tests + runs-on: + group: organization/macos-gh + env: + EVENT_NOKQUEUE: 1 + PUB_KEY: ${{ secrets.SDK_PUB_KEY }} + SUB_KEY: ${{ secrets.SDK_SUB_KEY }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Checkout actions + uses: actions/checkout@v4 + with: + repository: pubnub/client-engineering-deployment-tools + ref: v1 + token: ${{ secrets.GH_TOKEN }} + path: .github/.release/actions + - name: Integration tests + uses: ./.github/.release/actions/actions/runners/unity + with: + project-path: ./PubnubChatUnity + test-mode: play + license-username: ${{ secrets.UNITYCI_NEW_USER }} + license-password: ${{ secrets.UNITYCI_NEW_PASS }} + license-serial: ${{ secrets.UNITYCI_NEW_SERIAL }} + - name: Cancel workflow runs for commit on error + if: failure() + uses: ./.github/.release/actions/actions/utils/fast-jobs-failure + all-tests: + name: Tests + needs: [tests] + runs-on: + group: organization/Default + steps: + - name: Tests summary + run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" diff --git a/unity-chat/.github/workflows/run-validations.yml b/unity-chat/.github/workflows/run-validations.yml new file mode 100644 index 0000000..a8835d9 --- /dev/null +++ b/unity-chat/.github/workflows/run-validations.yml @@ -0,0 +1,42 @@ +name: Validations + +on: + push: + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash + +jobs: + pubnub-yml: + name: "Validate .pubnub.yml" + runs-on: + group: organization/Default + steps: + - name: Checkout project + uses: actions/checkout@v4 + - name: Checkout validator action + uses: actions/checkout@v4 + with: + repository: pubnub/client-engineering-deployment-tools + ref: v1 + token: ${{ secrets.GH_TOKEN }} + path: .github/.release/actions + - name: "Run '.pubnub.yml' file validation" + uses: ./.github/.release/actions/actions/validators/pubnub-yml + with: + token: ${{ secrets.GH_TOKEN }} + - name: Cancel workflow runs for commit on error + if: failure() + uses: ./.github/.release/actions/actions/utils/fast-jobs-failure + all-validations: + name: Validations + needs: [pubnub-yml] + runs-on: + group: organization/Default + steps: + - name: Validations summary + run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed" diff --git a/unity-chat/.pubnub.yml b/unity-chat/.pubnub.yml new file mode 100644 index 0000000..c2f8199 --- /dev/null +++ b/unity-chat/.pubnub.yml @@ -0,0 +1,138 @@ +--- +version: v0.2.0 +changelog: + - date: 2024-01-10 + version: v0.2.0 + changes: + - type: feature + text: "Added MessageDraft functionality." +sdks: + - + full-name: PubNub Unity Chat SDK + short-name: Unity Chat + artifacts: + - + artifact-type: package + language: C# + tier: 2 + tags: + - Desktop + - Game Engine + source-repository: https://github.com/pubnub/unity-chat + documentation: https://www.pubnub.com/docs/chat/unity-chat-sdk + distributions: + - + distribution-type: source-code + distribution-repository: GitHub release + package-name: pubnub + location: https://github.com/pubnub/unity-chat + supported-platforms: + supported-operating-systems: + Linux: + runtime-version: + - Unity Engine 5.x+ + minimum-os-version: + - Ubuntu 12.04 + maximum-os-version: + - Ubuntu 20.04 LTS + target-architecture: + - x86-64 + macOS: + runtime-version: + - Unity Engine 5.x+ + minimum-os-version: + - macOS 10.12 + maximum-os-version: + - macOS 11.0.1 + target-architecture: + - x86-64 + Windows: + runtime-version: + - Unity Engine 5.x+ + minimum-os-version: + - Windows Vista Ultimate + maximum-os-version: + - Windows 11 Home + target-architecture: + - x86-64 +features: + access: + - ACCESS-OBJECTS-V2-MANAGEMENT + - ACCESS-SECRET-KEY-ALL-ACCESS + - ACCESS-GRANT-TOKEN + - ACCESS-PARSE-TOKEN + - ACCESS-SET-TOKEN + - ACCESS-REVOKE-TOKEN + channel-groups: + - CHANNEL-GROUPS-ADD-CHANNELS + - CHANNEL-GROUPS-REMOVE-CHANNELS + - CHANNEL-GROUPS-REMOVE-GROUPS + - CHANNEL-GROUPS-LIST-CHANNELS-IN-GROUP + presence: + - PRESENCE-HERE-NOW + - PRESENCE-WHERE-NOW + - PRESENCE-SET-STATE + - PRESENCE-GET-STATE + - PRESENCE-HEARTBEAT + publish: + - PUBLISH-STORE-FLAG + - PUBLISH-RAW-JSON + - PUBLISH-WITH-METADATA + - PUBLISH-GET + - PUBLISH-POST + - PUBLISH-SYNC + - PUBLISH-ASYNC + - PUBLISH-FIRE + - PUBLISH-REPLICATION-FLAG + storage: + - STORAGE-INCLUDE-TIMETOKEN + - STORAGE-COUNT + - STORAGE-REVERSE + - STORAGE-START-END + - STORAGE-MESSAGE-COUNT + - STORAGE-HISTORY-WITH-META + - STORAGE-FETCH-WITH-META + - STORAGE-FETCH-WITH-MESSAGE-ACTIONS + subscribe: + - SUBSCRIBE-CHANNELS + - SUBSCRIBE-CHANNEL-GROUPS + - SUBSCRIBE-PRESENCE-CHANNELS + - SUBSCRIBE-PRESENCE-CHANNELS-GROUPS + - SUBSCRIBE-WILDCARD + - SUBSCRIBE-FILTER-EXPRESSION + - SUBSCRIBE-SIGNAL-LISTENER + - SUBSCRIBE-USER-LISTENER + - SUBSCRIBE-SPACE-LISTENER + - SUBSCRIBE-MEMBERSHIP-LISTENER + - SUBSCRIBE-MESSAGE-ACTIONS-LISTENER + signal: + - SIGNAL-SEND + objects: + - OBJECTS-GET-USER + - OBJECTS-GET-USERS + - OBJECTS-CREATE-USER + - OBJECTS-UPDATE-USER + - OBJECTS-DELETE-USER + - OBJECTS-GET-SPACE + - OBJECTS-GET-SPACES + - OBJECTS-CREATE-SPACE + - OBJECTS-UPDATE-SPACE + - OBJECTS-DELETE-SPACE + - OBJECTS-GET-MEMBERSHIPS + - OBJECTS-JOIN-SPACES + - OBJECTS-UPDATE-MEMBERSHIPS + - OBJECTS-LEAVE-SPACES + - OBJECTS-GET-MEMBERS + - OBJECTS-ADD-MEMBERS + - OBJECTS-UPDATE-MEMBERS + - OBJECTS-REMOVE-MEMBERS + message-actions: + - MESSAGE-ACTIONS-GET + - MESSAGE-ACTIONS-ADD + - MESSAGE-ACTIONS-REMOVE +supported-platforms: + - version: PubNub Unity Chat SDK + platforms: + - Windows + - Mac OS + - Unix \ No newline at end of file