Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Transifex steps to separate workflow triggered by workflow_run #2899

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 1 addition & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,4 @@ jobs:
with:
os: ${{ matrix.os }}
name: wallet module
build-root-dir: wallets

if_merged:
if: github.event.pull_request.merged == true
name: Push translation source files to Transifex
runs-on: ubuntu-latest
steps:
- name: "Check if TX_TOKEN secret exists"
env:
transifex_secret: ${{secrets.TX_TOKEN}}
if: ${{env.transifex_secret == ''}}
run: |
echo "The secret \"TX_TOKEN\" has not been set; please go to \"settings \> secrets and variables\" to create it"
exit 1
- name: Checkout
uses: actions/[email protected]
- name: Push source files using transifex client
uses: transifex/cli-action@v2
with:
token: ${{ secrets.TX_TOKEN }}
args: push -s
build-root-dir: wallets
50 changes: 50 additions & 0 deletions .github/workflows/sync_transifex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Transifex

on:
workflow_run:
workflows: [ Build Bisq 2 ]
types: [ completed ]

jobs:
if_merged:
name: Push translation source files to Transifex
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
# Fetch all history so we can check commits properly
fetch-depth: 0

- name: Check if the commit is in the main branch
id: check_commit
run: |
git fetch origin main
if git merge-base --is-ancestor ${{ github.event.workflow_run.head_sha }} origin/main; then
echo "commit_in_main=true" >> $GITHUB_OUTPUT
else
echo "commit_in_main=false" >> $GITHUB_OUTPUT
fi

- name: "Check if TX_TOKEN secret exists"
if: "steps.check_commit.outputs.commit_in_main == 'true'"
env:
transifex_secret: ${{ secrets.TX_TOKEN }}
run: |
if [ -z "$transifex_secret" ]; then
echo "The secret \"TX_TOKEN\" has not been set; please go to \"settings > secrets and variables\" to create it"
exit 1
fi

- name: Checkout at the specific commit
if: "steps.check_commit.outputs.commit_in_main == 'true'"
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}

- name: Push source files using Transifex client
if: "steps.check_commit.outputs.commit_in_main == 'true'"
uses: transifex/cli-action@v2
with:
token: ${{ secrets.TX_TOKEN }}
args: push -s
Loading