Skip to content

Update translations #40

Update translations

Update translations #40

Workflow file for this run

name: "Update translations"
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
permissions: {}
defaults:
run:
shell: pwsh
jobs:
update-translations:
permissions:
contents: write # for git push
runs-on: ubuntu-latest
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.ref }}
- name: l10n-push
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
# we need to use a different docker image for those two, this appears to be a bit tricky with github actions out of the box
run: bash .github/workflows/run-in-docker.sh owncloudci/transifex:latest "cd ownCloud/Resources/en.lproj && tx push -s --skip"
- name: l10n-pull
run: bash .github/workflows/run-in-docker.sh owncloudci/transifex:latest "tx pull --all --skip --minimum-perc=75 --force"
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y clang libpython2.7 libpython2.7-dev
- name: Download Swift
run: wget https://swift.org/builds/swift-5.3-release/ubuntu2004/swift-5.3-RELEASE/swift-5.3-RELEASE-ubuntu20.04.tar.gz
- name: Extract Swift
run: tar xzf swift-5.3-RELEASE-ubuntu20.04.tar.gz
- name: Move Swift to /usr/share
run: sudo mv swift-5.3-RELEASE-ubuntu20.04 /usr/share/swift
- name: Add Swift to PATH
run: echo "export PATH=/usr/share/swift/usr/bin:\$PATH" >> $GITHUB_ENV
- name: Verify Swift installation
run: swift -v
- name: Compile Swift file
run: swiftc tools/normalizestrings/main.swift -o ocstringstool
- name: Run compiled Swift program
run: ./ocstringstool normalize ownCloud/Resources/
- name: update-repo-before-commit
run: |
git add ownCloud/Resources/**/*.strings
git status
git stash
- name: commit and push
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
run: |
install -d -m 0700 ~/.ssh
Set-Content -Value "${{ secrets.DEPLOYMENT_SSH_KEY }}" -Path ~/.ssh/id_ed25519
chmod 0600 ~/.ssh/id_ed25519
if(git stash list) {
git stash pop
install -d -m 0700 ~/.ssh
Set-Content -Value "${{ secrets.DEPLOYMENT_SSH_KEY }}" -Path ~/.ssh/id_ed25519
chmod 0600 ~/.ssh/id_ed25519
git config user.name "ownClouders"
git config user.email "[email protected]"
git add ownCloud/Resources/**/*.strings
git commit -m "[tx] updated client translations from transifex [skip ci]"
git push [email protected]:owncloud/ios-app.git
}