mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix fetching translations for builds
This commit is contained in:
parent
e44ade8688
commit
425cff529c
1 changed files with 25 additions and 8 deletions
33
.github/workflows/build-and-release.yml
vendored
33
.github/workflows/build-and-release.yml
vendored
|
|
@ -14,7 +14,7 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ always() }}
|
if: ${{ always() && needs.fetch-translations.result != 'failure' }}
|
||||||
needs: [determine-build, fetch-translations]
|
needs: [determine-build, fetch-translations]
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -24,6 +24,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
if: ${{ always() && needs.fetch-translations.result == 'skipped' }}
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
@ -80,23 +81,32 @@ jobs:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: determine-build
|
needs: determine-build
|
||||||
# Only works in MCCTeam repository, since it needs crowdin secrets.
|
# Translations will only be fetched in the MCCTeam repository, since it needs crowdin secrets.
|
||||||
if: ${{ github.repository == 'MCCTeam/Minecraft-Console-Client' }}
|
if: ${{ github.repository == 'MCCTeam/Minecraft-Console-Client' }}
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Cache
|
- name: Check cache
|
||||||
uses: actions/cache@v3.2.4
|
uses: actions/cache/restore@v3
|
||||||
id: cache-check
|
id: cache-check
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/*
|
path: ${{ github.workspace }}/*
|
||||||
key: 'translation-${{ github.sha }}'
|
key: "translation-${{ github.sha }}"
|
||||||
|
lookup-only: true
|
||||||
|
restore-keys: "translation-"
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
if: steps.cache-check.outputs.cache-hit != 'true'
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: 'true'
|
||||||
|
|
||||||
- name: Download translations from crowdin
|
- name: Download translations from crowdin
|
||||||
uses: crowdin/github-action@v1.6.0
|
uses: crowdin/github-action@v1.6.0
|
||||||
if: steps.cache-check.outputs.cache-hit != 'true'
|
if: steps.cache-check.outputs.cache-hit != 'true'
|
||||||
with:
|
with:
|
||||||
upload_sources: true
|
upload_sources: false
|
||||||
upload_translations: false
|
upload_translations: false
|
||||||
download_translations: true
|
download_translations: true
|
||||||
|
|
||||||
|
|
@ -110,9 +120,16 @@ jobs:
|
||||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
|
||||||
|
|
||||||
|
- name: Save cache
|
||||||
|
uses: actions/cache/save@v3
|
||||||
|
if: steps.cache-check.outputs.cache-hit != 'true'
|
||||||
|
with:
|
||||||
|
path: ${{ github.workspace }}/*
|
||||||
|
key: "translation-${{ github.sha }}"
|
||||||
|
|
||||||
build-transition-version:
|
build-transition-version:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ always() }}
|
if: ${{ always() && needs.fetch-translations.result != 'failure' }}
|
||||||
needs: [determine-build, fetch-translations]
|
needs: [determine-build, fetch-translations]
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -123,6 +140,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
if: ${{ always() && needs.fetch-translations.result == 'skipped' }}
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
@ -175,7 +193,6 @@ jobs:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
mode: uploadReleaseAsset
|
mode: uploadReleaseAsset
|
||||||
filePath: ${{ env.target-out-path }}/mcc-${{ matrix.target }}.zip
|
filePath: ${{ env.target-out-path }}/mcc-${{ matrix.target }}.zip
|
||||||
# ${{ env.PROJECT }}-linux.zip
|
|
||||||
assetName: ${{ env.PROJECT }}-${{ (contains(matrix.target, 'linux-x64') && 'linux.zip') || (contains(matrix.target, 'win-x86') && 'windows-x86.zip') || (contains(matrix.target, 'win-x64') && 'windows-x64.zip') || (contains(matrix.target, 'linux-arm64') && 'linux-arm64.zip') || (contains(matrix.target, 'osx-x64') && 'osx.zip') }}
|
assetName: ${{ env.PROJECT }}-${{ (contains(matrix.target, 'linux-x64') && 'linux.zip') || (contains(matrix.target, 'win-x86') && 'windows-x86.zip') || (contains(matrix.target, 'win-x64') && 'windows-x64.zip') || (contains(matrix.target, 'linux-arm64') && 'linux-arm64.zip') || (contains(matrix.target, 'osx-x64') && 'osx.zip') }}
|
||||||
tag: ${{ format('{0}-{1}', env.date, github.run_number) }}
|
tag: ${{ format('{0}-{1}', env.date, github.run_number) }}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue