Skip to content

Commit

Permalink
Unity CI
Browse files Browse the repository at this point in the history
  • Loading branch information
skibitsky committed Sep 20, 2024
1 parent 7a850e0 commit dbbae86
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 61 deletions.
File renamed without changes.
74 changes: 74 additions & 0 deletions .github/workflows/unity-bulid-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build Unity Sample

on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:

jobs:
buildForAllSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- 'Samples/AppKit Sample'
targetPlatform:
# - StandaloneOSX # Build a macOS standalone (Intel 64-bit).
# - StandaloneWindows # Build a Windows standalone.
- StandaloneWindows64 # Build a Windows 64-bit standalone.
# - StandaloneLinux64 # Build a Linux 64-bit standalone.
# - iOS # Build an iOS player.
- Android # Build an Android .apk standalone app.
- WebGL # WebGL.
steps:
- uses: jlumbroso/[email protected]
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
restore-keys: Library-
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
buildsPath: Build
projectPath: ${{ matrix.projectPath }}
targetPlatform: ${{ matrix.targetPlatform }}
customParameters: -Development -mixpanelToken ${{ secrets.MIXPANEL_TOKEN }} -sentryToken ${{ secrets.SENTRY_TOKEN }}
buildMethod: UnityBuilderAction.Builder.BuildProject
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: Build/${{ matrix.targetPlatform }}

deployToVercel:
name: Deploy to Vercel
runs-on: ubuntu-latest
needs: buildForAllSupportedPlatforms
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download WebGL Build Artifact
uses: actions/download-artifact@v3
with:
name: Build-WebGL
path: Build/WebGL
- name: Deploy to Vercel
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-comment: true
working-directory: Build/WebGL/WebGL
8 changes: 8 additions & 0 deletions .idea/.idea.Reown/.idea/sonarlint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 23 additions & 60 deletions .idea/.idea.Reown/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions sample/Reown.AppKit.Unity/Assets/Scripts/AppKitInit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ await AppKit.InitializeAsync(
)
);

#if !UNITY_WEBGL
var clientId = await AppKit.Instance.SignClient.CoreClient.Crypto.GetClientId();
Mixpanel.Identify(clientId);
#endif

Debug.Log($"[AppKit Init] AppKit initialized. Loading menu scene...");
SceneManager.LoadScene(_menuScene);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ private async void UpdateClientIdInfoItem()
_scrollContentContainer.Add(_clientIdInfoItem);
}


#if !UNITY_WEBGL
private void OnSceneLoaded(Scene arg0, LoadSceneMode arg1)
{
UpdateClientIdInfoItem();
}
#endif

private void OnSettingsButtonClicked()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ PlayerSettings:
blurSplashScreenBackground: 1
spritePackerPolicy:
webGLMemorySize: 32
webGLExceptionSupport: 1
webGLExceptionSupport: 2
webGLNameFilesAsHashes: 0
webGLShowDiagnostics: 0
webGLDataCaching: 1
Expand Down

0 comments on commit dbbae86

Please sign in to comment.