-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Include crowdin workflow * Update .github/workflows/crowdin-pull.yml Co-authored-by: Chris Marslender <[email protected]> * Update .github/workflows/crowdin-push.yml Co-authored-by: Chris Marslender <[email protected]> --------- Co-authored-by: Chris Marslender <[email protected]>
- Loading branch information
1 parent
165e840
commit 950a51d
Showing
2 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Pull translations from Crowdin | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr_target: | ||
description: "PR Target Branch for Updated Translations" | ||
type: string | ||
default: "main" | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pull-from-crowdin: | ||
runs-on: [k8s-public] | ||
container: node:18 | ||
env: | ||
localization_branch_name: l10n_crowdin_translations | ||
steps: | ||
- name: Add safe git directory | ||
uses: Chia-Network/actions/git-mark-workspace-safe@main | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "${{ inputs.pr_target || github.ref_name }}" | ||
|
||
- name: Vault Login | ||
uses: Chia-Network/actions/vault/login@main | ||
with: | ||
vault_url: ${{ secrets.VAULT_URL }} | ||
role_name: github-chia-docs | ||
|
||
- name: Get secrets from vault | ||
uses: hashicorp/vault-action@v2 | ||
with: | ||
url: ${{ secrets.VAULT_URL }} | ||
token: ${{ env.VAULT_TOKEN }} | ||
secrets: | | ||
secret/data/crowdin token | CROWDIN_PERSONAL_TOKEN; | ||
secret/data/crowdin project-id-docs | CROWDIN_PROJECT_ID; | ||
# Setting this up globally so that we can also commit the compiled translations after crowdin runs | ||
- uses: Chia-Network/actions/commit-sign/gpg@main | ||
with: | ||
gpg_private_key: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_KEY_RSA }} | ||
passphrase: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_PASSPHRASE }} | ||
|
||
- name: crowdin action | ||
uses: crowdin/[email protected] | ||
with: | ||
upload_sources: false | ||
upload_translations: false | ||
download_translations: true | ||
crowdin_branch_name: main | ||
localization_branch_name: ${{ env.localization_branch_name }} | ||
create_pull_request: true | ||
pull_request_title: "New Crowdin Translations" | ||
pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)" | ||
pull_request_base_branch_name: "${{ inputs.pr_target || 'main' }}" | ||
github_user_name: "Chia Automation" | ||
github_user_email: "[email protected]" | ||
gpg_private_key: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_KEY_RSA }} | ||
gpg_passphrase: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_PASSPHRASE }} | ||
skip_ref_checkout: "true" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Compile Updated translations | ||
run: | | ||
npm install | ||
npm run locale | ||
(git add . && git commit -m "Compiled Translations" && git push origin ${{ env.localization_branch_name }}) || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Push strings to Crowdin | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
push-to-crowdin: | ||
runs-on: [k8s-public] | ||
container: node:18 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Vault Login | ||
uses: Chia-Network/actions/vault/login@main | ||
with: | ||
vault_url: ${{ secrets.VAULT_URL }} | ||
role_name: github-chia-docs | ||
|
||
- name: Get secrets from vault | ||
uses: hashicorp/vault-action@v2 | ||
with: | ||
url: ${{ secrets.VAULT_URL }} | ||
token: ${{ env.VAULT_TOKEN }} | ||
secrets: | | ||
secret/data/crowdin token | CROWDIN_PERSONAL_TOKEN; | ||
secret/data/crowdin project-id-docs | CROWDIN_PROJECT_ID; | ||
- name: crowdin action | ||
uses: crowdin/[email protected] | ||
with: | ||
upload_sources: true | ||
upload_translations: false | ||
download_translations: false | ||
crowdin_branch_name: ${{ github.ref_name }} # The "branch" (folder) in crowdin to source from. Match the branch name in GH | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |