fix(ci): make the test-APK dispatch inputs work and stop it always publishing
🏗️ Build and Test JellyTau / Run Tests (push) Successful in 26m0s
🏗️ Build and Test JellyTau / Supply Chain (push) Successful in 4m3s
Publish Documentation / Build & publish docs to gitea-pages (push) Successful in 8m59s
Traceability Validation / Check Requirement Traces (push) Successful in 28s
🏗️ Build and Test JellyTau / Android Compile Check (push) Successful in 10m45s

Two defects in a workflow that had never actually run.

The publish guard was `if: ${{ inputs.publish }}`. A dispatch input arrives
as a *string*, and every non-empty string is truthy in the expression
language, so "false" is truthy too -- the workflow would have published a
public pre-release on every run, including the ones where the box was
deliberately left unticked. Now compared against 'true' explicitly.

The bare `inputs.*` context is also newer than `github.event.inputs.*` and
no other workflow here uses either, so nothing proved the short form works
on this Gitea. Switched to the form both Gitea and GitHub have supported
throughout; an unresolved context would have silently expanded to an empty
string, sending every build down the `debug` branch and then failing to
find a `*-debug.apk`.
This commit is contained in:
2026-09-03 20:19:59 +02:00
parent 10d77f1380
commit b5a3a3b427
+16 -11
View File
@@ -63,7 +63,7 @@ env:
jobs:
build:
name: Build test APK (${{ inputs.variant }}, ${{ inputs.abi }})
name: Build test APK (${{ github.event.inputs.variant }}, ${{ github.event.inputs.abi }})
runs-on: linux/amd64
container:
image: gitea.tourolle.paris/dtourolle/jellytau-builder:2026.08.1
@@ -129,30 +129,30 @@ jobs:
# APK actually carries, which has silently regressed before.
- name: Build APK
run: |
if [ "${{ inputs.variant }}" = "side-by-side-release" ]; then
./scripts/build-android.sh release --debug --abi "${{ inputs.abi }}"
if [ "${{ github.event.inputs.variant }}" = "side-by-side-release" ]; then
./scripts/build-android.sh release --debug --abi "${{ github.event.inputs.abi }}"
else
./scripts/build-android.sh debug --abi "${{ inputs.abi }}"
./scripts/build-android.sh debug --abi "${{ github.event.inputs.abi }}"
fi
- name: Collect APK
id: collect
run: |
mkdir -p dist/test-apk
if [ "${{ inputs.variant }}" = "side-by-side-release" ]; then
if [ "${{ github.event.inputs.variant }}" = "side-by-side-release" ]; then
PATTERN='*-release.apk'
else
PATTERN='*-debug.apk'
fi
APK=$(find src-tauri/gen/android/app/build/outputs/apk -name "$PATTERN" | head -1)
if [ -z "$APK" ]; then
echo "❌ No APK produced for variant ${{ inputs.variant }}"
echo "❌ No APK produced for variant ${{ github.event.inputs.variant }}"
find src-tauri/gen/android/app/build/outputs/apk -name '*.apk' || true
exit 1
fi
REF_NAME=$(echo "${GITHUB_REF#refs/heads/}" | tr '/' '-')
OUT="dist/test-apk/jellytau-${REF_NAME}-${GITHUB_SHA::8}-${{ inputs.variant }}.apk"
OUT="dist/test-apk/jellytau-${REF_NAME}-${GITHUB_SHA::8}-${{ github.event.inputs.variant }}.apk"
cp "$APK" "$OUT"
# Report what the thing actually is, not what it was meant to be.
@@ -166,8 +166,8 @@ jobs:
echo "|---|---|"
echo "| Branch | \`${GITHUB_REF#refs/heads/}\` |"
echo "| Commit | \`${GITHUB_SHA::8}\` |"
echo "| Variant | \`${{ inputs.variant }}\` |"
echo "| ABI | \`${{ inputs.abi }}\` |"
echo "| Variant | \`${{ github.event.inputs.variant }}\` |"
echo "| ABI | \`${{ github.event.inputs.abi }}\` |"
echo "| Size | $(du -h "$OUT" | cut -f1) |"
echo "| SHA256 | \`$(sha256sum "$OUT" | cut -d' ' -f1)\` |"
echo ""
@@ -190,7 +190,12 @@ jobs:
# static latest.json from the `updater` branch, not the release list, so a
# pre-release published here is invisible to anyone without the link.
- name: Publish as a pre-release
if: ${{ inputs.publish }}
# Compared against the string 'true', not used as a bare truthiness
# test. A dispatch input arrives as a *string*, and every non-empty
# string is truthy in the expression language — so `if: inputs.publish`
# would publish a pre-release on every run, including the ones where the
# box was deliberately left unticked.
if: ${{ github.event.inputs.publish == 'true' }}
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
AUTO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -212,7 +217,7 @@ jobs:
"normal install and with its own separate data. Uninstalling it does not touch" \
"the real app." \
"" \
"Variant: \`${{ inputs.variant }}\` · ABI: \`${{ inputs.abi }}\`" \
"Variant: \`${{ github.event.inputs.variant }}\` · ABI: \`${{ github.event.inputs.abi }}\`" \
"" \
"Android will warn about installing from an unknown source; that is expected" \
"for a build signed with a debug key rather than the store key.")