diff --git a/.github/scripts/transifex.sh b/.github/scripts/transifex.sh new file mode 100644 index 00000000..108623ed --- /dev/null +++ b/.github/scripts/transifex.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +function command_exists() { + command -v "$1" >/dev/null 2>&1 +} + +if ! command_exists tx; then + echo "Transifex CLI is not installed. Installing..." + curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash + mv tx /usr/local/bin/tx +fi + +if [ ! -f .tx/config ]; then + echo "Transifex config file (.tx/config) not found in the repository." + exit 1 +fi + +echo "Pushing translation source file to Transifex..." +tx push -s + +if [ $? -ne 0 ]; then + echo "Error: Transifex push failed. Please check the error message above." + exit 1 +else + echo "Translation source file successfully pushed to Transifex." +fi \ No newline at end of file diff --git a/.github/workflows/build_publish_openelis.yml b/.github/workflows/build_publish_openelis.yml index ae4783ee..8e260cd2 100644 --- a/.github/workflows/build_publish_openelis.yml +++ b/.github/workflows/build_publish_openelis.yml @@ -59,3 +59,8 @@ jobs: file: package/docker/openelis/Dockerfile push: true tags: bahmni/openelis:${{env.ARTIFACT_VERSION}},bahmni/openelis:latest + - name: Push Translations to Transifex + run: | + bash .github/scripts/transifex.sh + env: + TX_TOKEN: ${{ secrets.TX_TOKEN }}