From d9bbebddb0629af5690ad5a9ea408fafb8904335 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 28 May 2021 13:24:18 +1000 Subject: [PATCH] Update github actions --- .github/workflows/coverage.yaml | 9 ++++- .github/workflows/mysql.yaml | 9 ++++- .github/workflows/postgresql.yaml | 9 ++++- .github/workflows/style.yaml | 9 ++++- .github/workflows/translations.yml | 60 ++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/translations.yml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index d903b737e4..6576b7860a 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -2,7 +2,14 @@ name: SQLite -on: ["push", "pull_request"] +on: + push: + branches-ignore: + - l10* + + pull_request: + branches-ignore: + - l10* jobs: diff --git a/.github/workflows/mysql.yaml b/.github/workflows/mysql.yaml index 70acad66a1..fecc84957f 100644 --- a/.github/workflows/mysql.yaml +++ b/.github/workflows/mysql.yaml @@ -2,7 +2,14 @@ name: MySQL -on: ["push", "pull_request"] +on: + push: + branches-ignore: + - l10* + + pull_request: + branches-ignore: + - l10* jobs: diff --git a/.github/workflows/postgresql.yaml b/.github/workflows/postgresql.yaml index 76981e5a1b..0540d463bf 100644 --- a/.github/workflows/postgresql.yaml +++ b/.github/workflows/postgresql.yaml @@ -2,7 +2,14 @@ name: PostgreSQL -on: ["push", "pull_request"] +on: + push: + branches-ignore: + - l10* + + pull_request: + branches-ignore: + - l10* jobs: diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index 31da3ec61a..df52de1dcb 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -1,6 +1,13 @@ name: Style Checks -on: ["push", "pull_request"] +on: + push: + branches-ignore: + - l10* + + pull_request: + branches-ignore: + - l10* jobs: style: diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 0000000000..24106c028e --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,60 @@ +name: Update Translation Files + +on: + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + INVENTREE_DB_NAME: './test_db.sqlite' + INVENTREE_DB_ENGINE: django.db.backends.sqlite3 + INVENTREE_DEBUG: info + INVENTREE_MEDIA_ROOT: ./media + INVENTREE_STATIC_ROOT: ./static + + steps: + - uses: actions/checkout@v2 + - name: Get Current Translations + run: | + git fetch + git checkout origin/l10 -- `git ls-tree origin/l10 -r --name-only | grep ".po"` + git reset + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y gettext + pip3 install invoke + invoke install + - name: Make Translations + run: | + invoke translate + - name: stash changes + run: | + git stash + - name: Checkout Translation Branch + uses: actions/checkout@v2.3.4 + with: + ref: l10 + - name: Commit files + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git checkout stash -- . + git reset + git add "*.po" + git commit -m "updated translation base" + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: l10