diff --git a/.github/workflows/check_for_crowdin_updates.yml b/.github/workflows/check_for_crowdin_updates.yml index 25a8877..f9ee6ef 100644 --- a/.github/workflows/check_for_crowdin_updates.yml +++ b/.github/workflows/check_for_crowdin_updates.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - fetch_convert_and_diff_translations: + fetch_translations: runs-on: ubuntu-latest steps: - name: Checkout Repo Content @@ -14,40 +14,11 @@ jobs: with: path: 'scripts' # don't provide a branch (ref) so it uses the default for that event - - name: Checkout Android - uses: actions/checkout@v4 - with: - repository: 'oxen-io/session-android' - path: 'android' - submodules: recursive - ref: 'release/1.20.0' - - name: Checkout Desktop - uses: actions/checkout@v4 - with: - repository: 'oxen-io/session-desktop' - path: 'desktop' - ref: 'standardised_strings_qa_2' - - name: Checkout iOS - uses: actions/checkout@v4 - with: - repository: 'oxen-io/session-ios' - path: 'ios' - ref: 'dev' - name: Setup Python uses: actions/setup-python@v5 with: python-version: 3.8 cache: 'pip' # caching pip dependencies - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - cache: gradle - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Install Dependencies run: | pip install -r ${{ github.workspace }}/scripts/crowdin/requirements.txt @@ -62,28 +33,65 @@ jobs: --glossary_id 407522 \ --concept_id 36 \ --skip-untranslated-strings - - name: Upload xliff artefacts uses: actions/upload-artifact@v4 with: name: session-xliff-artefact - path: "{{ github.workspace }}/raw_translations/*" + path: | + ${{ github.workspace }}/raw_translations/*.xliff overwrite: true if-no-files-found: warn retention-days: 7 - - name: Prepare Android Strings + build_ios: + runs-on: ubuntu-latest + needs: [fetch_translations] + steps: + - name: Checkout iOS + uses: actions/checkout@v4 + with: + repository: 'oxen-io/session-ios' + path: 'ios' + ref: 'dev' + + - name: Install Dependencies run: | - python "${{ github.workspace }}/scripts/crowdin/generate_android_strings.py" \ + pip install -r ${{ github.workspace }}/scripts/crowdin/requirements.txt + - name: Prepare iOS Strings + run: | + python "${{ github.workspace }}/scripts/crowdin/generate_ios_strings.py" \ "${{ github.workspace }}/raw_translations" \ - "${{ github.workspace }}/android/libsession/src/main/res" \ - "${{ github.workspace }}/android/libsession/src/main/java/org/session/libsession/utilities/NonTranslatableStringConstants.kt" + "${{ github.workspace }}/ios/Session/Meta" \ + "${{ github.workspace }}/ios/SessionUtilitiesKit/General/Constants.swift" + build_qa: + runs-on: ubuntu-latest + needs: [fetch_translations] + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + cache: 'pip' # caching pip dependencies + + - name: Install Dependencies + run: | + pip install -r ${{ github.workspace }}/scripts/crowdin/requirements.txt + + build_desktop: + needs: [fetch_translations] + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + cache: 'pip' # caching pip dependencies - - name: Print Android Strings + - name: Install Dependencies run: | - ls -l "${{ github.workspace }}/android/libsession/src/main/res/" + pip install -r ${{ github.workspace }}/scripts/crowdin/requirements.txt - name: Prepare Desktop Strings run: | @@ -92,12 +100,55 @@ jobs: "${{ github.workspace }}/raw_translations" \ "${{ github.workspace }}/desktop/_locales" \ "${{ github.workspace }}/desktop/ts/localization/constants.ts" - - name: Prepare iOS Strings + + + build_android: + runs-on: ubuntu-latest + needs: [fetch_translations] + + steps: + - name: Checkout Android + uses: actions/checkout@v4 + with: + repository: 'oxen-io/session-android' + path: 'android' + submodules: recursive + ref: 'release/1.20.0' + - name: Checkout Desktop + uses: actions/checkout@v4 + with: + repository: 'oxen-io/session-desktop' + path: 'desktop' + ref: 'standardised_strings_qa_2' + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + cache: 'pip' # caching pip dependencies + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + cache: gradle + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Install Dependencies run: | - python "${{ github.workspace }}/scripts/crowdin/generate_ios_strings.py" \ + pip install -r ${{ github.workspace }}/scripts/crowdin/requirements.txt + + - name: Prepare Android Strings + run: | + python "${{ github.workspace }}/scripts/crowdin/generate_android_strings.py" \ "${{ github.workspace }}/raw_translations" \ - "${{ github.workspace }}/ios/Session/Meta" \ - "${{ github.workspace }}/ios/SessionUtilitiesKit/General/Constants.swift" + "${{ github.workspace }}/android/libsession/src/main/res" \ + "${{ github.workspace }}/android/libsession/src/main/java/org/session/libsession/utilities/NonTranslatableStringConstants.kt" + + + - name: Upload Android artefacts uses: actions/upload-artifact@v4 @@ -154,7 +205,10 @@ jobs: - + make_prs: + needs: [build_android, build_ios, build_qa, build_desktop] + runs-on: ubuntu-latest + steps: # Not sure why yet, but uploading artefacts after creating the pull requests # seems to only include a part of what should be in. # As a dirty fix we upload the artefacts first, and then make the pull request