Skip to content

Commit

Permalink
chore: test breaking workflow into separate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Sep 19, 2024
1 parent 3a7326e commit da88d7b
Showing 1 changed file with 97 additions and 43 deletions.
140 changes: 97 additions & 43 deletions .github/workflows/check_for_crowdin_updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,19 @@ on:
workflow_dispatch:

jobs:
fetch_convert_and_diff_translations:
fetch_translations:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo Content
uses: actions/checkout@v4
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
Expand All @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit da88d7b

Please sign in to comment.