mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 07:39:42 +00:00
Trigger Crowdin upload via RestrictedActions
This commit is contained in:
34
.github/workflows/crowdin-upload-trigger.yml
vendored
Normal file
34
.github/workflows/crowdin-upload-trigger.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Upload translations to Crowdin
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- resources/translations/eng.ini
|
||||
branches:
|
||||
- stable
|
||||
- minor-next
|
||||
- major-next
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
name: Upload translations
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Generate access token
|
||||
id: generate-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ vars.RESTRICTED_ACTIONS_DISPATCH_ID }}
|
||||
private-key: ${{ secrets.RESTRICTED_ACTIONS_DISPATCH_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
repositories: RestrictedActions
|
||||
|
||||
- name: Dispatch restricted action
|
||||
uses: peter-evans/repository-dispatch@v3
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
repository: ${{ github.repository_owner }}/RestrictedActions
|
||||
event-type: pocketmine_mp_crowdin_upload
|
||||
client-payload: '{"branch": "${{ github.ref_name }}"}'
|
38
.github/workflows/upload-translations.yml
vendored
38
.github/workflows/upload-translations.yml
vendored
@@ -1,38 +0,0 @@
|
||||
name: Upload translations to Crowdin
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- resources/translations/eng.ini
|
||||
branches:
|
||||
- stable
|
||||
- minor-next
|
||||
- major-next
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
upload:
|
||||
name: Upload translations
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Preprocess eng.ini placeholders so Crowdin can understand them
|
||||
working-directory: resources/translations
|
||||
run: |
|
||||
sed -i -r 's/\{%([A-Za-z0-9]+)\}/\{\1\}/g' eng.ini
|
||||
cat eng.ini
|
||||
|
||||
- name: Upload eng.ini to Crowdin
|
||||
uses: crowdin/github-action@v2
|
||||
with:
|
||||
upload_sources: true
|
||||
upload_translations: false
|
||||
download_translations: false
|
||||
create_pull_request: false
|
||||
crowdin_branch_name: ${{ github.ref_name }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
Reference in New Issue
Block a user