Browse Source
[ci] tx update ci
Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3009/head
crueter
4 months ago
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
1 changed files with
63 additions and
0 deletions
-
.github/workflows/translations.yml
|
|
|
@ -0,0 +1,63 @@ |
|
|
|
name: tx-pull |
|
|
|
|
|
|
|
on: |
|
|
|
# monday, wednesday, saturday at 2pm |
|
|
|
cron: |
|
|
|
- '0 14 * * 1,3,6' |
|
|
|
push: |
|
|
|
branches: [ master ] |
|
|
|
|
|
|
|
jobs: |
|
|
|
license-header: |
|
|
|
runs-on: source |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v4 |
|
|
|
with: |
|
|
|
fetch-depth: 0 |
|
|
|
|
|
|
|
- name: Get New Translations |
|
|
|
run: tx pull -t |
|
|
|
|
|
|
|
- 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: | |
|
|
|
TITLE="[dist, android] Update translations from Transifex for $(date)" |
|
|
|
BODY="Automatic translation update for $(date)" |
|
|
|
BASE=master |
|
|
|
HEAD=update-translations-$TIMESTAMP |
|
|
|
DATA=$(jq -n \ |
|
|
|
--arg base "$BASE" \ |
|
|
|
--arg body "$BODY" \ |
|
|
|
--arg title "$TITLE" \ |
|
|
|
--arg head "$HEAD" \ |
|
|
|
'{ |
|
|
|
"base": "$base", |
|
|
|
"body": "$body", |
|
|
|
"head": "$head", |
|
|
|
"title": "$title" |
|
|
|
}') |
|
|
|
|
|
|
|
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" --fail |
|
|
|
|