Skip to content

Update transifex-push.yml #8

Update transifex-push.yml

Update transifex-push.yml #8

name: Push Translations to Transifex
on:
push:
branches:
- '3.15' # Triggers automatically when updates are made to this branch
workflow_dispatch: # Allows you to trigger it manually from the GitHub Actions tab
permissions:
contents: read
jobs:
push-translations:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ '3.15' ]
steps:
- uses: styfle/cancel-workflow-action@main
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@master
with:
python-version: 3
# Install the dependencies and the Transifex CLI binary exactly like your pull script
- name: Install Dependencies
run: |
sudo apt-get install -y gettext
pip install requests cogapp polib transifex-python sphinx-intl blurb six
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
working-directory: /usr/local/bin
- uses: actions/checkout@master
with:
ref: ${{ matrix.version }}
fetch-depth: 0
# Generate the mapping using the script located inside .github/workflows/
- name: Generate Transifex Configuration
run: |
chmod +x .github/workflows/transifex-util.py
python3 .github/workflows/transifex-util.py recreate_tx_config --language ta --project-slug python-newest --version ${{ matrix.version }}
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
# Prints out the configuration file contents in the logs to visually confirm file mappings
- name: Debug Transifex Config Paths
run: cat .tx/config
# Push your local .po translation files directly up to Transifex
- name: Push translations to Transifex
run: |
tx push -t -l ta --use-git-timestamps
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}