From b18830cd81327dfa49191061d153a8cc8986e507 Mon Sep 17 00:00:00 2001 From: Olivier Brian Date: Mon, 11 Mar 2024 08:32:25 +0100 Subject: [PATCH] add workflows --- .../workflows/github-actions-demo.yml.demo | 18 ++++++++ .github/workflows/tx-pull.yml | 42 +++++++++++++++++++ .github/workflows/tx-update.yml | 21 ++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .github/workflows/github-actions-demo.yml.demo create mode 100644 .github/workflows/tx-pull.yml create mode 100644 .github/workflows/tx-update.yml diff --git a/.github/workflows/github-actions-demo.yml.demo b/.github/workflows/github-actions-demo.yml.demo new file mode 100644 index 0000000..15a61d6 --- /dev/null +++ b/.github/workflows/github-actions-demo.yml.demo @@ -0,0 +1,18 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/.github/workflows/tx-pull.yml b/.github/workflows/tx-pull.yml new file mode 100644 index 0000000..4d028f1 --- /dev/null +++ b/.github/workflows/tx-pull.yml @@ -0,0 +1,42 @@ +name: Pull latest translations fom transifex and make a PR +run-name: ${{ github.actor }} is github with latest translations from transifex 🚀 +on: + pull_request: + types: + - closed + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Transifex CLI action + uses: transifex/cli-action@v2 + with: + token: ${{ secrets.TX_TOKEN }} + - uses: actions/checkout@v4 + - name: List files in the repository + run: ls ${{ github.workspace }} + - name: Show tranisfex version + run: /tmp/tx/tx -v +# - name: Pull from transifex +# run: /tmp/tx/tx pull --translations --all --force + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.PAT }} + commit-message: Update translations from transifex + committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> + signoff: false + branch: tx-update + delete-branch: true + title: '[TX] Update translations from transifex' + body: | + Update translations + - Updated with *today's* date + - Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request + Ready to merge. + draft: false \ No newline at end of file diff --git a/.github/workflows/tx-update.yml b/.github/workflows/tx-update.yml new file mode 100644 index 0000000..0c5d374 --- /dev/null +++ b/.github/workflows/tx-update.yml @@ -0,0 +1,21 @@ +name: Update transifex with latest translations +run-name: ${{ github.actor }} is updating transifex 🚀 +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Transifex CLI action + uses: transifex/cli-action@v2 + with: + token: ${{ secrets.TX_TOKEN }} + - uses: actions/checkout@v4 + - name: List files in the repository + run: ls ${{ github.workspace }} + - name: Show tranisfex version + run: /tmp/tx/tx -v + - name: Update gettext and create po files + run: echo tbd + - name: Push to transifex + run: /tmp/tx/tx push \ No newline at end of file