14
14
jobs :
15
15
build :
16
16
runs-on : ubuntu-latest
17
- if : ${{ always() }}
17
+ if : ${{ always() && needs.fetch-translations.result != 'failure' }}
18
18
needs : [determine-build, fetch-translations]
19
19
timeout-minutes : 15
20
20
strategy :
24
24
steps :
25
25
- name : Checkout
26
26
uses : actions/checkout@v3
27
+ if : ${{ always() && needs.fetch-translations.result == 'skipped' }}
27
28
with :
28
29
fetch-depth : 0
29
30
submodules : ' true'
@@ -80,23 +81,32 @@ jobs:
80
81
fail-fast : true
81
82
runs-on : ubuntu-latest
82
83
needs : determine-build
83
- # Only works in MCCTeam repository, since it needs crowdin secrets.
84
+ # Translations will only be fetched in the MCCTeam repository, since it needs crowdin secrets.
84
85
if : ${{ github.repository == 'MCCTeam/Minecraft-Console-Client' }}
85
86
timeout-minutes : 15
86
87
87
88
steps :
88
- - name : Cache
89
- uses : actions/cache@v3.2.4
89
+ - name : Check cache
90
+ uses : actions/cache/restore @v3
90
91
id : cache-check
91
92
with :
92
93
path : ${{ github.workspace }}/*
93
- key : ' translation-${{ github.sha }}'
94
+ key : " translation-${{ github.sha }}"
95
+ lookup-only : true
96
+ restore-keys : " translation-"
94
97
98
+ - name : Checkout
99
+ uses : actions/checkout@v3
100
+ if : steps.cache-check.outputs.cache-hit != 'true'
101
+ with :
102
+ fetch-depth : 0
103
+ submodules : ' true'
104
+
95
105
- name : Download translations from crowdin
96
106
97
107
if : steps.cache-check.outputs.cache-hit != 'true'
98
108
with :
99
- upload_sources : true
109
+ upload_sources : false
100
110
upload_translations : false
101
111
download_translations : true
102
112
@@ -109,10 +119,17 @@ jobs:
109
119
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
110
120
CROWDIN_PROJECT_ID : ${{ secrets.CROWDIN_PROJECT_ID }}
111
121
CROWDIN_PERSONAL_TOKEN : ${{ secrets.CROWDIN_TOKEN }}
122
+
123
+ - name : Save cache
124
+ uses : actions/cache/save@v3
125
+ if : steps.cache-check.outputs.cache-hit != 'true'
126
+ with :
127
+ path : ${{ github.workspace }}/*
128
+ key : " translation-${{ github.sha }}"
112
129
113
130
build-transition-version :
114
131
runs-on : ubuntu-latest
115
- if : ${{ always() }}
132
+ if : ${{ always() && needs.fetch-translations.result != 'failure' }}
116
133
needs : [determine-build, fetch-translations]
117
134
timeout-minutes : 15
118
135
strategy :
@@ -123,6 +140,7 @@ jobs:
123
140
steps :
124
141
- name : Checkout
125
142
uses : actions/checkout@v3
143
+ if : ${{ always() && needs.fetch-translations.result == 'skipped' }}
126
144
with :
127
145
fetch-depth : 0
128
146
submodules : ' true'
@@ -175,7 +193,6 @@ jobs:
175
193
github_token : ${{ secrets.GITHUB_TOKEN }}
176
194
mode : uploadReleaseAsset
177
195
filePath : ${{ env.target-out-path }}/mcc-${{ matrix.target }}.zip
178
- # ${{ env.PROJECT }}-linux.zip
179
196
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') }}
180
197
tag : ${{ format('{0}-{1}', env.date, github.run_number) }}
181
198
0 commit comments