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

Configure github actions #312

Closed
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
18 changes: 10 additions & 8 deletions .github/workflows/crowdin_export.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# GitHub Action to export latest changes to en.json to https://lang.purrbot.site
#
name: "Crowdin Import GH Action"
name: "Crowdin Export GH Action"

on:
push: # Trigger on push towards the en.json file.
Expand All @@ -16,15 +16,17 @@ jobs:
steps:
- name: "Update Code"
uses: actions/Checkout@v2

- name: "Export Crowdin Translations"
uses: crowdin/github-action@v1.0.20
uses: crowdin/github-action@1.0.21
with:
upload_sources: true # Upload sources
crowdin_branch_name: 'master'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that even needed? I would assume it defaults to that branch so why apply this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have some branch in your crowdin project you need this option, without it will export to root of project.


download_translations: false # Don't download translations from Crowdin
skip_untranslated_files: true # Only download fully translated files
translation: "src/main/resources/lang/%locale%.%file_extension%"
upload_sources: true

upload_translations: false
download_translations: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
CROWDIN_ID: ${{ secrets.CROWDIN_ID }}
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
45 changes: 37 additions & 8 deletions .github/workflows/crowdin_import.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,32 @@ name: "Crowdin Import GH Action"
on:
schedule:
- cron: "0/10 * * * *" # Check every 10 minutes for updates.

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_ID: ${{ secrets.CROWDIN_ID }}
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}

jobs:
import:
runs-on: ubuntu-latest
steps:
- name: "Update Code"
uses: actions/Checkout@v2
- name: "Import Crowdin Translations"
uses: crowdin/github-action@v1.0.20

- name: Download French translations
uses: crowdin/github-action@1.0.21
with:
download_language: 'fr'
crowdin_branch_name: 'master'

upload_sources: false # Don't upload sources

download_translations: true # Download translations from Crowdin
skip_untranslated_files: true # Only download fully translated files
translation: "src/main/resources/lang/%locale%.%file_extension%"

push_translations: true # Push translations to branch
commit_message: "Updated %language%"
commit_message: "Updated French"
localization_branch_name: "translations" # Git branch for translations

create_pull_request: true
Expand All @@ -33,7 +41,28 @@ jobs:
New Translations were made for the bot.
If you want to help making them, read about it on our [Documentation](https://docs.purrbot.site/contribute/translate/)
pull_request_labels: "Type: Translation"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}


- name: Download German, Switzerland translations
uses: crowdin/github-action@1.0.21
with:
download_language: 'de-CH'
crowdin_branch_name: 'master'

upload_sources: false # Don't upload sources

download_translations: true # Download translations from Crowdin
skip_untranslated_files: true # Only download fully translated files

push_translations: true # Push translations to branch
commit_message: "Updated German, Switzerland"
localization_branch_name: "translations" # Git branch for translations

create_pull_request: true
pull_request_title: "New Crowdin Translations"
pull_request_body: |-
New Translations were made for the bot.
If you want to help making them, read about it on our [Documentation](https://docs.purrbot.site/contribute/translate/)
pull_request_labels: "Type: Translation"


9 changes: 6 additions & 3 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
commit_message: "Update %language%"
append_commit_message: false
project_id_env: CROWDIN_ID
api_token_env: CROWDIN_TOKEN

preserve_hierarchy: true

files:
- source: src/main/resources/lang/en.json
translation: /src/main/resources/lang/%locale%.%file_extension%
translation: src/main/resources/lang/%locale%.%file_extension%