name: Unity-Cross-Platform-Build on: [push] jobs: build: name: Build for ${{ matrix.targetPlatform }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: targetPlatform: - StandaloneWindows64 # 윈도우용 - StandaloneOSX # 맥용 steps: - name: Checkout code uses: actions/checkout@v4 - name: Build Project (Recursive Search Strike) run: | # 1. 경로 변환 방지 (Check) export MSYS_NO_PATHCONV=1 sudo chmod -R 777 . # 2. Assets 폴더가 있는 "진짜 프로젝트 경로"를 자동으로 찾아냅니다. (Check) TARGET_DIR=$(find $(pwd) -name "Assets" -type d -exec dirname {} \;) echo "Found Assets at: $TARGET_DIR" # 3. 그 진짜 주소로 유니티 빌드 시작! (Check) docker run --rm \ -v "$TARGET_DIR:$TARGET_DIR" \ -w "$TARGET_DIR" \ -e UNITY_LICENSE="${{ secrets.UNITY_LICENSE }}" \ -e UNITY_EMAIL="${{ secrets.UNITY_EMAIL }}" \ -e UNITY_PASSWORD="${{ secrets.UNITY_PASSWORD }}" \ unityci/editor:ubuntu-6000.2.15f1-windows-mono-3 \ unity-editor -batchmode -quit -projectPath "$TARGET_DIR" -buildTarget StandaloneWindows64 - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: Build-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }}