From 87c4f658ce7e471c6b7ce33c92d1973460af6091 Mon Sep 17 00:00:00 2001 From: crueter Date: Wed, 12 Nov 2025 05:21:49 +0100 Subject: [PATCH] [ci] tx update ci (#3008) Signed-off-by: crueter Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3008 --- .github/workflows/sources.yml | 2 +- .github/workflows/translations.yml | 61 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/translations.yml diff --git a/.github/workflows/sources.yml b/.github/workflows/sources.yml index 20cb03c449..8e98419cba 100644 --- a/.github/workflows/sources.yml +++ b/.github/workflows/sources.yml @@ -5,7 +5,7 @@ on: branches: [ master ] jobs: - license-header: + sources: runs-on: source steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 0000000000..07037c7f94 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,61 @@ +name: tx-pull + +on: + # monday, wednesday, saturday at 2pm + schedule: + cron: + - '0 14 * * 1,3,6' + +jobs: + tx-update: + runs-on: source + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get New Translations + run: tx-cli pull -t -f + + - name: Push branch + run: | + git config --local user.name "Eden CI" + git config --local user.email "ci@eden-emu.dev" + git config --local user.signingkey "D57652791BB25D2A" + git config --local push.autoSetupRemote true + + git remote set-url origin ci:eden-emu/eden.git + + TIMESTAMP=$(date +"%s") + echo "TIMESTAMP=$TIMESTAMP" >> "$GITHUB_ENV" + + git switch -c update-translations-$TIMESTAMP + git add dist src/android/app/src/main/res + + git commit -sS -m "[dist, android] Update translations from Transifex" + git push + + - name: Create PR + run: | + DATE=$(date +"%b %d") + TITLE="[dist, android] Update translations from Transifex for $DATE" + BODY="Automatic translation update for $DATE" + BASE=master + HEAD=update-translations-$TIMESTAMP + + cat << EOF > data.json + { + "base": "$BASE", + "body": "$BODY", + "head": "$HEAD", + "title": "$TITLE" + } + EOF + + curl -X 'POST' \ + 'https://git.eden-emu.dev/api/v1/repos/eden-emu/eden/pulls' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer ${{ secrets.CI_FJ_TOKEN }}' \ + -H 'Content-Type: application/json' \ + -d "@data.json" --fail +