Resolve the keystore path in-step rather than via runner.temp
CI / build (push) Successful in 1m18s
Release / apk (push) Successful in 1m42s

If that context is unset on this runner the keystore would be written
somewhere unintended; resolve it with a fallback and export the result
so the build and cleanup steps agree on one path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Mateusz PstruchaandClaude Opus 5 committed 2026-09-22 22:13:41 +02:00
1 parent 4dedfd8207
commit c83d1d5823
1 file changed
+8 -3
+8 -3
View File
@@ -65,11 +65,16 @@ jobs:
echo "::error::ANDROID_KEYSTORE_B64 is not set — refusing to publish an unsigned release."
exit 1
fi
echo "$KEYSTORE_B64" | base64 -d > "$RUNNER_TEMP/tern-release.jks"
# Resolve the path here rather than via ${{ runner.temp }}: if that
# context is empty on this runner, the keystore would be written to
# an unintended location. Export it so later steps use the same one.
KS="${RUNNER_TEMP:-${GITHUB_WORKSPACE:-$PWD}}/tern-release.jks"
echo "$KEYSTORE_B64" | base64 -d > "$KS"
chmod 600 "$KS"
echo "TERN_KEYSTORE_PATH=$KS" >> "$GITHUB_ENV"
- name: Build signed APK
env:
TERN_KEYSTORE_PATH: ${{ runner.temp }}/tern-release.jks
TERN_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
TERN_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
TERN_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
@@ -90,7 +95,7 @@ jobs:
- name: Clean up keystore
if: always()
run: rm -f "$RUNNER_TEMP/tern-release.jks"
run: rm -f "${TERN_KEYSTORE_PATH:-}"
- name: Create release
uses: akkuman/gitea-release-action@v1