forked from connectbot/connectbot
-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (64 loc) · 2.21 KB
/
translations-import.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This workflow imports translations from Launchpad
name: Translations import
on:
schedule:
# Runs at 10PM PST
- cron: '0 6 * * *'
pull_request:
branches: [main]
paths:
- ".github/workflows/translations-import.yml"
- "translations/**"
jobs:
import:
name: Import translations from Launchpad
runs-on: ubuntu-latest
if: github.repository_owner == 'connectbot'
env:
BAZAAR_URI: lp:~kennyr/connectbot/po-output
PO_SUBDIR: app/locale
steps:
- uses: actions/checkout@v4
- name: Install bazaar
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
bzr \
ca-certificates \
rsync
- name: Branch Bazaar translation exports
run: |
cd ${{ runner.temp }}
bzr branch lp:~kennyr/connectbot/po-output
cd po-output
echo "REVNO=$(bzr revno)" >> $GITHUB_ENV
- name: Copy exported translations to workspace
run: |
rsync -av --exclude .bzr \
--exclude '**/oc.po' --exclude '**/[email protected]' --exclude '**/tk.po' \
"${{ runner.temp }}/${BAZAAR_URI##*/}/" "${GITHUB_WORKSPACE}/${PO_SUBDIR}/"
echo $REVNO > "${GITHUB_WORKSPACE}/${PO_SUBDIR}/.revno"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Try importing the translations
run: |
TRANSLATIONS_ONLY=1 ./gradlew :translations:importToAndroid
- name: Create pull request
if: github.event_name != 'pull_request'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
Automated translations import
Translations imported from Launchpad.
author: Translations Bot <[email protected]>
title: '[Translations] Automatic update'
body: |
Automated import of translations from Launchpad.
labels: translations, automated pr
assignees: kruton
reviewers: kruton
branch: translations/import
- name: Report pull request creation
if: github.event_name != 'pull_request'
run: echo "Created pull request number ${{ env.PULL_REQUEST_NUMBER }}"