Translations import #607
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow imports translations from Launchpad | |
name: Translations import | |
on: | |
schedule: | |
# Runs at 10PM PST | |
- cron: '0 6 * * *' | |
jobs: | |
import: | |
runs-on: ubuntu-latest | |
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]' \ | |
"${{ runner.temp }}/${BAZAAR_URI##*/}/" "${GITHUB_WORKSPACE}/${PO_SUBDIR}/" | |
echo $REVNO > "${GITHUB_WORKSPACE}/${PO_SUBDIR}/.revno" | |
- name: Try importing the translations | |
run: | | |
TRANSLATIONS_ONLY=1 ./gradlew :translations:importToAndroid | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v5 | |
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 | |
run: echo "Created pull request number ${{ env.PULL_REQUEST_NUMBER }}" |