Skip to content

Commit 4f873f0

Browse files
committed
ADFA-2602: Qualify the asset zip URL by toolchain version
Two runs from different toolchains wrote the same R2 key, so the second silently replaced the first at one stable URL and the Slack links were indistinguishable -- a tester who downloaded from the earlier message got 8.14.3 assets while believing they had 9.6.1. Read GRADLE_DISTRIBUTION_VERSION from the checked-out org.adfa.constants and key the upload as assets/<version>/assets-<arch>.zip, so an 8.14.3 and a 9.6.1 set can coexist and the URL says which is which. The Slack message now names the Gradle version alongside the ref. Claude-Session: https://claude.ai/code/session_017HGpMsUzZ5wxCfMtDZ2HGP
1 parent 10b6bbb commit 4f873f0

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/generate_assets.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,16 @@ jobs:
327327
-Dorg.gradle.workers.max=1 \
328328
-Dorg.gradle.parallel=false
329329
330+
- name: Read the toolchain version
331+
id: toolchain
332+
run: |
333+
set -euo pipefail
334+
CONSTANTS=composite-builds/build-deps-common/constants/src/main/java/org/adfa/constants/constants.kt
335+
ver=$(grep 'GRADLE_DISTRIBUTION_VERSION' "$CONSTANTS" | grep -o '"[0-9.]*"' | tr -d '"')
336+
[ -n "$ver" ] || { echo "ERROR: could not read GRADLE_DISTRIBUTION_VERSION"; exit 1; }
337+
echo "GRADLE_VERSION=$ver" >> $GITHUB_OUTPUT
338+
echo "toolchain: gradle $ver"
339+
330340
- name: Verify assets zip
331341
id: assets_zip
332342
run: |
@@ -354,22 +364,24 @@ jobs:
354364
CLOUDFLARE_KEY_ID: ${{ vars.CLOUDFLARE_KEY_ID }}
355365
CLOUDFLARE_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
356366
R2_BUCKET: ${{ vars.R2_ASSETS_BUCKET || 'apk-repo' }}
357-
R2_KEY_PREFIX: assets/
367+
R2_KEY_PREFIX: assets/${{ steps.toolchain.outputs.GRADLE_VERSION }}/
358368
run: |
359369
uv run --with boto3 scripts/cloudflare-r2-upload.py "${{ steps.assets_zip.outputs.ASSETS_PATH }}"
360-
echo "DOWNLOAD_URL=https://download.appdevforall.org/assets/assets-${{ matrix.arch }}.zip" >> $GITHUB_OUTPUT
370+
echo "DOWNLOAD_URL=https://download.appdevforall.org/assets/${{ steps.toolchain.outputs.GRADLE_VERSION }}/assets-${{ matrix.arch }}.zip" >> $GITHUB_OUTPUT
361371
362372
- name: Send Slack notification
363373
env:
364374
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
365375
ASSET_LABEL: ${{ matrix.label }}
366376
DOWNLOAD_URL: ${{ steps.r2.outputs.DOWNLOAD_URL }}
367377
BUILD_REF: ${{ inputs.ref }}
378+
GRADLE_VERSION: ${{ steps.toolchain.outputs.GRADLE_VERSION }}
368379
run: |
369380
jq -n \
370381
--arg label "$ASSET_LABEL" \
371382
--arg url "$DOWNLOAD_URL" \
372383
--arg ref "$BUILD_REF" \
384+
--arg gradle "$GRADLE_VERSION" \
373385
'{
374386
blocks: [
375387
{
@@ -392,7 +404,7 @@ jobs:
392404
elements: [
393405
{
394406
type: "mrkdwn",
395-
text: "Built from `\($ref)`. Push to `/sdcard/Download/` on the device, then `adb shell touch` it."
407+
text: "Gradle \($gradle), built from `\($ref)`. Push to `/sdcard/Download/` on the device, then `adb shell touch` it."
396408
}
397409
]
398410
}

0 commit comments

Comments
 (0)