ci: save APKs as workflow artifacts; best-effort package registry upload
Some checks failed
Android Build & Publish / android (push) Failing after 1m58s
Some checks failed
Android Build & Publish / android (push) Failing after 1m58s
This commit is contained in:
@@ -93,10 +93,21 @@ jobs:
|
|||||||
working-directory: android
|
working-directory: android
|
||||||
run: ./gradlew assembleRelease --no-daemon
|
run: ./gradlew assembleRelease --no-daemon
|
||||||
|
|
||||||
# ── 9. Publish to Gitea generic package registry ─────────────────────────
|
# ── 9. Upload APKs as workflow artifacts ─────────────────────────────────
|
||||||
|
- name: Upload APKs as artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: scopone-android-${{ github.run_number }}
|
||||||
|
path: |
|
||||||
|
android/app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
android/app/build/outputs/apk/release/app-release-unsigned.apk
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
# ── 10. Publish to Gitea generic package registry (best-effort) ──────────
|
||||||
- name: Publish APKs to Gitea package registry
|
- name: Publish APKs to Gitea package registry
|
||||||
|
continue-on-error: true
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ github.token }}
|
GITEA_ACTOR: ${{ gitea.actor }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
VERSION="${{ github.run_number }}"
|
VERSION="${{ github.run_number }}"
|
||||||
@@ -105,23 +116,18 @@ jobs:
|
|||||||
upload() {
|
upload() {
|
||||||
local src="$1" dst_name="$2"
|
local src="$1" dst_name="$2"
|
||||||
echo "→ Uploading $dst_name (version $VERSION)…"
|
echo "→ Uploading $dst_name (version $VERSION)…"
|
||||||
# --output /dev/null discards the body; --write-out captures only the 3-digit code
|
|
||||||
HTTP=$(curl --silent --show-error \
|
HTTP=$(curl --silent --show-error \
|
||||||
--output /dev/null --write-out "%{http_code}" \
|
--output /dev/null --write-out "%{http_code}" \
|
||||||
-X PUT \
|
-X PUT \
|
||||||
-H "Authorization: token $TOKEN" \
|
-u "gitea-actions:${{ secrets.GITEA_TOKEN }}" \
|
||||||
--upload-file "$src" \
|
--upload-file "$src" \
|
||||||
"$BASE/$VERSION/$dst_name")
|
"$BASE/$VERSION/$dst_name")
|
||||||
if [[ "$HTTP" != "20"* ]]; then
|
echo " HTTP $HTTP"
|
||||||
echo "✗ Upload failed — HTTP $HTTP"
|
if [[ "$HTTP" == "20"* ]]; then
|
||||||
# Retry once with verbose output for diagnostics
|
|
||||||
curl -v -X PUT \
|
|
||||||
-H "Authorization: token $TOKEN" \
|
|
||||||
--upload-file "$src" \
|
|
||||||
"$BASE/$VERSION/$dst_name" 2>&1 | tail -30 || true
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "✓ $dst_name → $BASE/$VERSION/$dst_name"
|
echo "✓ $dst_name → $BASE/$VERSION/$dst_name"
|
||||||
|
else
|
||||||
|
echo "⚠ Package registry upload skipped (HTTP $HTTP) — download APKs from the workflow artifacts above"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
upload android/app/build/outputs/apk/debug/app-debug.apk \
|
upload android/app/build/outputs/apk/debug/app-debug.apk \
|
||||||
@@ -129,6 +135,3 @@ jobs:
|
|||||||
|
|
||||||
upload android/app/build/outputs/apk/release/app-release-unsigned.apk \
|
upload android/app/build/outputs/apk/release/app-release-unsigned.apk \
|
||||||
app-release-unsigned.apk
|
app-release-unsigned.apk
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "📦 Package index: $BASE/$VERSION/"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user