11name : Build All
22run-name : ${{ inputs.release_type }} @ ${{ github.sha }}
33
4- permissions :
5- contents : write
6-
74concurrency :
85 group : delta
96
7+ permissions :
8+ contents : write
9+
1010on :
1111 workflow_dispatch :
1212 inputs :
3636 changelog :
3737 description : Changelog (b64 encoded)
3838
39-
4039env :
4140 token : ${{ secrets.PA_TOKEN || github.token }}
42- organization : Delta-Icons
4341 current_repo : ${{ github.repository }}
42+ organization : Delta-Icons
4443 website_repo : Delta-Icons/delta-icons.github.io
4544 package_name : website.leifs.delta
4645
@@ -51,26 +50,43 @@ jobs:
5150 steps :
5251
5352 - name : Checkout
54- uses : actions/checkout@v4
53+ uses : actions/checkout@v5
5554 with :
5655 token : ${{ env.token }}
5756 fetch-depth : 0
5857
59- - name : Export variables
60- run : |
61- python -u .github/scripts/resolve_paths.py -p >> $GITHUB_ENV
58+ - name : Setup Gradle
59+ uses : gradle/actions/setup-gradle@v5
60+ with :
61+ add-job-summary : never
6262
6363 - name : Setup Java
64- uses : actions/setup-java@v4
64+ uses : actions/setup-java@v5
6565 with :
66+ cache : gradle
6667 distribution : temurin
6768 java-version : 18
6869
69- - name : Install dependencies
70+ - name : Setup Python
71+ uses : actions/setup-python@v6
72+ with :
73+ cache : pip
74+ python-version : ' 3.13'
75+
76+ - name : Export vars
7077 run : |
71- sudo apt-get update
72- sudo apt-get install -y optipng
73- sudo pip install -r ${{ env.sd }}/requirements.txt
78+ python -u resources/scripts/resolve_paths.py -p >> $GITHUB_ENV
79+ due_on=$(TZ=UTC date --iso-8601=seconds -d "$(date +%Y-%m-01) +1 month") >> $GITHUB_ENV
80+
81+ - name : Install Python deps
82+ run : |
83+ pip install -r ${{ env.sd }}/requirements.txt
84+
85+ - name : Install Linux deps
86+ uses : awalsh128/cache-apt-pkgs-action@latest
87+ with :
88+ packages : optipng
89+ version : 1.0
7490
7591 - name : Configure tools
7692 run : |
@@ -87,19 +103,26 @@ jobs:
87103 -r ${{ inputs.release_type }} \
88104 -v ${{ inputs.version_type }} >> $GITHUB_ENV
89105
90- - name : Add new icons
106+ - name : Add icons
91107 run : |
92108 python -u ${{ env.sd }}/add_icons_wrapper.py
93109
94- - name : Set icon count
110+ - name : Set icons count
95111 run : |
96112 python ${{ env.sd }}/count_icons.py -w
97113
98114 - name : Optimize images
99115 run : |
100- bash ${{ env.sd }}/optimize_images.sh
116+ latest_tag=$(git tag --sort version:refname | grep -v 'beta' | tail -n 1)
117+ changes=$(git diff --name-only $latest_tag -- "***.png")
118+ if [[ $latest_tag && $changes ]]; then
119+ echo "Latest tag is $latest_tag; optimizing images since this tag"
120+ optipng $changes || true
121+ else
122+ echo 'No release tag or changed files found, skip optimizing'
123+ fi
101124
102- - name : Sort appfilter and drawable
125+ - name : Sort XMLs
103126 run : |
104127 cd ${{ env.sd }}
105128 python sort_appfilter.py -o
@@ -125,7 +148,7 @@ jobs:
125148
126149 echo "changelog=$changelog_tmp" >> $GITHUB_ENV
127150
128- - name : Commit pre-build changes
151+ - name : Commit pre-release changes
129152 run : |
130153 git add \
131154 app/build.gradle \
@@ -178,15 +201,15 @@ jobs:
178201 mv -v *play*.apk ${{ env.filename }}.apk 2> /dev/null || true
179202 mv -v *play*.aab ${{ env.filename }}.aab 2> /dev/null || true
180203
181- - name : Upload APKs to Artifacts
182- uses : actions/upload-artifact@v4
204+ - name : Upload signed builds to Artifacts
205+ uses : actions/upload-artifact@v5
183206 with :
184207 name : ${{ env.filename }}
185208 path : ${{ env.filename }}*.apk
186209 if-no-files-found : error
187- retention-days : 90
210+ retention-days : 30
188211
189- - name : Push pre-build changes
212+ - name : Push pre-release changes
190213 uses : ad-m/github-push-action@master
191214 with :
192215 github_token : ${{ env.token }}
@@ -238,7 +261,7 @@ jobs:
238261 github.repository_owner == env.organization &&
239262 inputs.publish == true
240263
241- - name : Update the requests list
264+ - name : Update requests
242265 uses : benc-uk/workflow-dispatch@v1
243266 with :
244267 repo : ${{ github.repository }}
@@ -248,7 +271,7 @@ jobs:
248271 github.repository_owner == env.organization &&
249272 inputs.publish == true
250273
251- - name : Promote beta to production channel
274+ - name : Promote Google Play beta to production
252275 uses : kevin-david/promote-play-release@v1.1.0
253276 with :
254277 service-account-json-raw : ${{ secrets.SERVICE_ACCOUNT }}
@@ -260,7 +283,7 @@ jobs:
260283 inputs.release_type == 'prod' &&
261284 inputs.publish == true
262285
263- - name : Update the website
286+ - name : Update website
264287 uses : benc-uk/workflow-dispatch@v1
265288 with :
266289 token : ${{ env.token }}
@@ -271,10 +294,11 @@ jobs:
271294 inputs.release_type == 'prod' &&
272295 inputs.publish == true
273296
274- - name : Close the current milestone
297+ - name : Close current milestone
275298 uses : oinume/create-scheduled-milestone-action@main
299+ continue-on-error : true
276300 with :
277- title : ${{ env.version }}
301+ title : ${{ env.version_name }}
278302 state : closed
279303 env :
280304 GITHUB_TOKEN : ${{ env.token }}
@@ -283,11 +307,13 @@ jobs:
283307 inputs.release_type == 'prod' &&
284308 inputs.publish == true
285309
286- - name : Open a new milestone
310+ - name : Open new milestone
287311 uses : oinume/create-scheduled-milestone-action@main
312+ continue-on-error : true
288313 with :
289314 title : ${{ env.version_next }}
290315 state : open
316+ due_on : ' ${{ env.due_on }}'
291317 env :
292318 GITHUB_TOKEN : ${{ env.token }}
293319 if : |
0 commit comments