Skip to content

chore: minor improvements #62

chore: minor improvements

chore: minor improvements #62

name: Build Unity Sample
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
jobs:
buildForAllSupportedPlatforms:
if: github.event.pull_request.draft == false
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- 'sample/Reown.AppKit.Unity'
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:
unityVersion: ${{ matrix.targetPlatform == 'WebGL' && '6000.0.27f1' || '2022.3.42f1' }}
buildsPath: Builds
projectPath: ${{ matrix.projectPath }}
targetPlatform: ${{ matrix.targetPlatform }}
customParameters: ${{ matrix.targetPlatform != 'WebGL' && '-Development' || '' }} -mixpanelToken ${{ secrets.MIXPANEL_TOKEN }} -sentryToken ${{ secrets.SENTRY_TOKEN }}
buildMethod: UnityBuilderAction.Builder.BuildProject
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: Builds/${{ 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: Builds/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: Builds/WebGL/WebGL