Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CI/CD for Unity Chat #8

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions unity-chat/.github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @xavrax @jakub-grzesiowski @parfeon
README.md @techwritermat @xavrax @jakub-grzesiowski @parfeon
44 changes: 44 additions & 0 deletions unity-chat/.github/workflows/commands-handler.yml
Original file line number Diff line number Diff line change
@@ -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 }}
54 changes: 54 additions & 0 deletions unity-chat/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions unity-chat/.github/workflows/release/versions.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
48 changes: 48 additions & 0 deletions unity-chat/.github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -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"
42 changes: 42 additions & 0 deletions unity-chat/.github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
@@ -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"
138 changes: 138 additions & 0 deletions unity-chat/.pubnub.yml
Original file line number Diff line number Diff line change
@@ -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