diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml new file mode 100644 index 0000000..b4339da --- /dev/null +++ b/.github/workflows/i18n.yml @@ -0,0 +1,60 @@ +name: Generate Translations + +on: + push: + branches: + - main + +jobs: + generate-translations: + name: Update and Generate Translations + runs-on: ubuntu-latest + permissions: write-all + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch full history for creating PRs + + # Set up JDK + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: wrapper + cache-read-only: false + + # Cache Gradle dependencies + - name: Cache Gradle dependencies + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Update Strings XML + run: ./gradlew updateStringsXml + + - name: Generate Translations + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + run: ./gradlew generateTranslations + + - name: Create Pull Request + if: steps.changes-check.outputs.changes != 'false' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: "Update Translations ${{ github.event.pull_request.number }}" + body: "Update Translations ${{ github.event.pull_request.number }}" + branch: i18n-${{ github.event.pull_request.number }} + base: main + labels: | + translations diff --git a/.gitignore b/.gitignore index aa724b7..583441d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ .externalNativeBuild .cxx local.properties +buildSrc/build \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 0897082..fcadee0 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,12 +4,24 @@