From 3f1b4a09bdc620e98a9f4473ac2eefd3adda80fe Mon Sep 17 00:00:00 2001 From: AnotherSeawhite <52661206+AnotherSeawhite@users.noreply.github.com> Date: Sat, 6 Apr 2024 13:11:03 +0900 Subject: [PATCH] Create pull-translation-and-compile.yml --- .../pull-translation-and-compile.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/pull-translation-and-compile.yml diff --git a/.github/workflows/pull-translation-and-compile.yml b/.github/workflows/pull-translation-and-compile.yml new file mode 100644 index 0000000000000..821d4f1ee3753 --- /dev/null +++ b/.github/workflows/pull-translation-and-compile.yml @@ -0,0 +1,46 @@ +name: "Pull translations from Transifex" + +on: + workflow_dispatch: + +jobs: + pull-translations: + if: github.repository == 'AnotherSeawhite/Cataclysm-DDA' + runs-on: ubuntu-22.04 + steps: + - name: install gettext tools + run: sudo apt-get install gettext + - name: "Install Transifex CLI" + run: | + curl -sL https://github.com/transifex/cli/releases/download/v1.6.4/tx-linux-amd64.tar.gz | sudo tar zxvf - -C /usr/bin tx + - name: "Delete existing i18n branch" + uses: actions/github-script@v6.3.3 + with: + github-token: ${{ secrets.TX_PR_CREATOR }} + script: | + try { + await github.rest.git.deleteRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: "heads/i18n" + }) + } catch (error) { + console.log(error) + } + - name: "Checkout" + uses: actions/checkout@v4 + - name: "Get current date" + uses: josStorer/get-current-time@v2.0.2 + id: current-date + with: + format: 'DD MMMM YYYY' + - name: Compile translations (windows) + run: | + lang/compile_mo.sh all + - name: "Upload Translation Artifact" + uses: actions/upload-artifact@v4 + with: + name: ready-to-use + path: lang/mo + compression-level: 0 + overwrite: true