From c50ac41e642eeb747fd6358ea7c5869e318d126e Mon Sep 17 00:00:00 2001 From: miro Date: Thu, 27 Feb 2025 20:02:35 +0000 Subject: [PATCH] refactor:integrate translations sync into release_workflow.yml --- .github/workflows/release_workflow.yml | 31 ++++++++++++++++++++++--- .github/workflows/sync_tx.yml | 32 -------------------------- 2 files changed, 28 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/sync_tx.yml diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml index 139e4e2..27e824e 100644 --- a/.github/workflows/release_workflow.yml +++ b/.github/workflows/release_workflow.yml @@ -4,10 +4,35 @@ on: pull_request: types: [closed] branches: [dev] + workflow_dispatch: jobs: + + translations: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v2 + with: + ref: dev + fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: "3.11" + + - name: Sync translations by gitlocalize-app[bot] + run: | + python scripts/sync_translations.py + + - name: Commit to dev + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Update translations + branch: dev + publish_alpha: - if: github.event.pull_request.merged == true + needs: translations uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master secrets: inherit with: @@ -34,6 +59,7 @@ jobs: message: | new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }} + publish_pypi: needs: publish_alpha if: success() # Ensure this job only runs if the previous job succeeds @@ -46,7 +72,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v1 with: - python-version: "3.10" + python-version: "3.11" - name: Install Build Tools run: | python -m pip install build wheel @@ -61,7 +87,6 @@ jobs: with: password: ${{secrets.PYPI_TOKEN}} - propose_release: needs: publish_alpha if: success() # Ensure this job only runs if the previous job succeeds diff --git a/.github/workflows/sync_tx.yml b/.github/workflows/sync_tx.yml deleted file mode 100644 index 2fd378e..0000000 --- a/.github/workflows/sync_tx.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Run script on merge to dev by gitlocalize-app - -on: - workflow_dispatch: - push: - branches: - - dev - -jobs: - run-script: - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v2 - with: - ref: dev - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.9 - - - name: Run script if merged by gitlocalize-app[bot] - if: github.event_name == 'push' && github.event.head_commit.author.username == 'gitlocalize-app[bot]' - run: | - python scripts/sync_translations.py - - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Update translations - branch: dev