Work in progress - GitHub workflow CI for localization
This commit is contained in:
27
.github/workflows/export_localizations.yaml
vendored
Normal file
27
.github/workflows/export_localizations.yaml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Export localizations
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
jobs:
|
||||
export_localizations:
|
||||
name: Export localizations
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Export Localizations
|
||||
run: xcodebuild -exportLocalizations -project damus.xcodeproj -localizationPath "damus Localizations" -exportLanguage en-US -exportLanguage es-419
|
||||
- name: Verify Source Localization
|
||||
run:
|
||||
- name: Commit Localizations
|
||||
run: |
|
||||
git --version
|
||||
git config user.name "GitHub Actions Bot"
|
||||
git config user.email "<>"
|
||||
git status
|
||||
git add damus/*.lproj "damus Localizations"
|
||||
git commit -m ""
|
||||
26
.github/workflows/import_localizations.yaml
vendored
Normal file
26
.github/workflows/import_localizations.yaml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Import localizations on Transifex pull requests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'transifex/**'
|
||||
paths:
|
||||
- 'damus Localizations/*.xcloc/Localized Contents/*.xliff'
|
||||
- '!damus Localizations/en-US.xcloc/Localized Contents/en-US.xliff'
|
||||
jobs:
|
||||
import_localizations:
|
||||
name: Import localizations on Transifex pull requests
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
- name: Import localizations
|
||||
run: find "damus Localizations" -name "*.xliff" | grep -v "en-US.xliff" | xargs -I % xcodebuild -importLocalizations -project damus.xcodeproj -localizationPath %
|
||||
- name: Commit imported localizations
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
default_author: github_actions
|
||||
add: '"**.strings" "**.stringsdict"'
|
||||
message: 'Import localizations'
|
||||
Reference in New Issue
Block a user