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
🏗️ 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:
@@ -63,7 +63,7 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
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
|
runs-on: linux/amd64
|
||||||
container:
|
container:
|
||||||
image: gitea.tourolle.paris/dtourolle/jellytau-builder:2026.08.1
|
image: gitea.tourolle.paris/dtourolle/jellytau-builder:2026.08.1
|
||||||
@@ -129,30 +129,30 @@ jobs:
|
|||||||
# APK actually carries, which has silently regressed before.
|
# APK actually carries, which has silently regressed before.
|
||||||
- name: Build APK
|
- name: Build APK
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ inputs.variant }}" = "side-by-side-release" ]; then
|
if [ "${{ github.event.inputs.variant }}" = "side-by-side-release" ]; then
|
||||||
./scripts/build-android.sh release --debug --abi "${{ inputs.abi }}"
|
./scripts/build-android.sh release --debug --abi "${{ github.event.inputs.abi }}"
|
||||||
else
|
else
|
||||||
./scripts/build-android.sh debug --abi "${{ inputs.abi }}"
|
./scripts/build-android.sh debug --abi "${{ github.event.inputs.abi }}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Collect APK
|
- name: Collect APK
|
||||||
id: collect
|
id: collect
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist/test-apk
|
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'
|
PATTERN='*-release.apk'
|
||||||
else
|
else
|
||||||
PATTERN='*-debug.apk'
|
PATTERN='*-debug.apk'
|
||||||
fi
|
fi
|
||||||
APK=$(find src-tauri/gen/android/app/build/outputs/apk -name "$PATTERN" | head -1)
|
APK=$(find src-tauri/gen/android/app/build/outputs/apk -name "$PATTERN" | head -1)
|
||||||
if [ -z "$APK" ]; then
|
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
|
find src-tauri/gen/android/app/build/outputs/apk -name '*.apk' || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REF_NAME=$(echo "${GITHUB_REF#refs/heads/}" | tr '/' '-')
|
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"
|
cp "$APK" "$OUT"
|
||||||
|
|
||||||
# Report what the thing actually is, not what it was meant to be.
|
# Report what the thing actually is, not what it was meant to be.
|
||||||
@@ -166,8 +166,8 @@ jobs:
|
|||||||
echo "|---|---|"
|
echo "|---|---|"
|
||||||
echo "| Branch | \`${GITHUB_REF#refs/heads/}\` |"
|
echo "| Branch | \`${GITHUB_REF#refs/heads/}\` |"
|
||||||
echo "| Commit | \`${GITHUB_SHA::8}\` |"
|
echo "| Commit | \`${GITHUB_SHA::8}\` |"
|
||||||
echo "| Variant | \`${{ inputs.variant }}\` |"
|
echo "| Variant | \`${{ github.event.inputs.variant }}\` |"
|
||||||
echo "| ABI | \`${{ inputs.abi }}\` |"
|
echo "| ABI | \`${{ github.event.inputs.abi }}\` |"
|
||||||
echo "| Size | $(du -h "$OUT" | cut -f1) |"
|
echo "| Size | $(du -h "$OUT" | cut -f1) |"
|
||||||
echo "| SHA256 | \`$(sha256sum "$OUT" | cut -d' ' -f1)\` |"
|
echo "| SHA256 | \`$(sha256sum "$OUT" | cut -d' ' -f1)\` |"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -190,7 +190,12 @@ jobs:
|
|||||||
# static latest.json from the `updater` branch, not the release list, so a
|
# static latest.json from the `updater` branch, not the release list, so a
|
||||||
# pre-release published here is invisible to anyone without the link.
|
# pre-release published here is invisible to anyone without the link.
|
||||||
- name: Publish as a pre-release
|
- 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:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
AUTO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
AUTO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -212,7 +217,7 @@ jobs:
|
|||||||
"normal install and with its own separate data. Uninstalling it does not touch" \
|
"normal install and with its own separate data. Uninstalling it does not touch" \
|
||||||
"the real app." \
|
"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" \
|
"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.")
|
"for a build signed with a debug key rather than the store key.")
|
||||||
|
|||||||
Reference in New Issue
Block a user