From 61108cc02e3e86e60793a96466753b4ca6f7b025 Mon Sep 17 00:00:00 2001 From: The Judge Date: Thu, 13 Jun 2024 23:00:47 -0700 Subject: [PATCH] Begin wrapper workflow --- .github/workflows/main.yml | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..b945328c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,94 @@ +name: Build Wrapper + +on: [push, workflow_dispatch] + +jobs: + build: + name: Build Wrapper + runs-on: ubuntu-latest + steps: + # Checkout + - name: Checkout repository + uses: actions/checkout@v4 + + # Cache + - uses: actions/cache@v3 + with: + path: Library + key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} + restore-keys: | + Library- + + # Build + - name: Build APK + uses: game-ci/unity-builder@v4 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + targetPlatform: Android + customImage: 'unityci/editor:ubuntu-2021.3.37f1-android-3.1.0' + androidExportType: androidPackage + androidKeystoreName: user.keystore + androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }} + androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }} + androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }} + + # Export + - name: Export Project + uses: game-ci/unity-builder@v4 + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + targetPlatform: Android + customImage: 'unityci/editor:ubuntu-2021.3.37f1-android-3.1.0' + buildsPath: exported + androidExportType: androidStudioProject + androidKeystoreName: qcxr.keystore + androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }} + androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }} + androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }} + + # Upload exported Android Studio project + - uses: actions/upload-artifact@v3 + with: + name: Exported + path: exported + update: + name: Update IL2CPP repo + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: QuestCraftPlusPlus/Wrapper-IL2CPP + - name: Grab IL2CPP changes + uses: actions/download-artifact@v4 + with: + name: Exported + run: | + cp -rf ${{ GITHUB_WORKSPACE }}/Exported/Android/unityLibrary/src/main/assets unityLibrary/src/main/assets + cp -rf ${{ GITHUB_WORKSPACE }}/Exported/Android/unityLibrary/src/main/jniLibs unityLibrary/src/main/jniLibs + cp -rf ${{ GITHUB_WORKSPACE }}/Exported/Android/unityLibrary/src/main/Il2CppOutputProject unityLibrary/src/main/Il2CppOutputProject + cp -rf ${{ GITHUB_WORKSPACE }}/Exported/Android/unityLibrary/src/main/jniStaticLibs unityLibrary/src/main/jniStaticLibs + cp -rf ${{ GITHUB_WORKSPACE }}/Exported/Android/unityLibrary/src/main/res unityLibrary/src/main/res + cp -rf ${{ GITHUB_WORKSPACE }}/Exported/Android/unityLibrary/src/main/resources unityLibrary/src/main/resources + cp -rf ${{ GITHUB_WORKSPACE }}/Exported/Android/launcher/src/main/res launcher/src/main/res + cp -f ${{ GITHUB_WORKSPACE }}/Exported/Android/unityLibrary/src/main/AndroidManifest.xml unityLibrary/src/main/AndroidManifest.xml + cp -f ${{ GITHUB_WORKSPACE }}/Exported/Android/launcher/src/main/AndroidManifest.xml launcher/src/main/AndroidManifest.xml + - name: Commit files + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -a -m "Auto-update" + - name: Push changes + uses: ad-m/github-push-action@master + with: + repository: QuestCraftPlusPlus/Wrapper-IL2CPP + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file