Update build-and-release.yml to enhance translation fetching logic

- Modified the condition for fetching translations to include checks for CROWDIN_PROJECT_ID and CROWDIN_PERSONAL_TOKEN.
- Added environment variables for CROWDIN credentials to streamline the translation process.
This commit is contained in:
BruceChen 2026-03-28 00:30:53 +08:00
parent 4b9e0e93aa
commit c42133797e

View file

@ -34,11 +34,12 @@ jobs:
fail-fast: true
runs-on: ubuntu-latest
needs: determine-build
# Translations will only be fetched in the MCCTeam repository, since it needs crowdin secrets.
if: ${{ needs.determine-build.outputs.skip != 'true' && github.repository == 'MCCTeam/Minecraft-Console-Client' }}
if: ${{ needs.determine-build.outputs.skip != 'true' }}
timeout-minutes: 15
steps:
steps:
- name: Check cache
uses: actions/cache/restore@v3
id: cache-check
@ -52,12 +53,13 @@ jobs:
if: steps.cache-check.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
fetch-depth: 0
submodules: 'true'
- name: Download translations from crowdin
uses: crowdin/github-action@v1.6.0
if: steps.cache-check.outputs.cache-hit != 'true'
# Translations will only be fetched when Crowdin tokens are available.
if: ${{ steps.cache-check.outputs.cache-hit != 'true' && secrets.CROWDIN_PROJECT_ID && secrets.CROWDIN_TOKEN }}
with:
upload_sources: false
upload_translations: false