6 Commits
Author SHA1 Message Date
amos ca9388e334 fix: 添加应用图标引用到 AndroidManifest
Android Release / release (push) Successful in 47s
2026-06-03 00:12:24 +08:00
amos 43277c5c67 feat: 设置应用图标 (ARKJ)
Android Release / release (push) Successful in 49s
2026-06-03 00:04:54 +08:00
amos 3cc811cd8e debug: 添加网络调试和多 endpoint 尝试
Android Release / release (push) Successful in 43s
2026-06-02 23:55:22 +08:00
amos 56298d080f fix: 修复变量传递问题
Android Release / release (push) Failing after 35s
2026-06-02 23:50:57 +08:00
amos 5cafc3b41c fix: 使用 Authorization: Basic Auth 认证
Android Release / release (push) Failing after 28s
2026-06-02 23:48:10 +08:00
amos 8971e8885d fix: 简化 Release 流程,直接使用 Basic Auth
Android Release / release (push) Failing after 28s
2026-06-02 23:44:43 +08:00
7 changed files with 42 additions and 46 deletions
+37 -42
View File
@@ -50,53 +50,48 @@ jobs:
echo "APK_FILE=$APK_FILE" >> $GITHUB_ENV echo "APK_FILE=$APK_FILE" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create or Update Release - name: Debug Network
id: create_release
env:
GITEA_USER: ${{ secrets.GITEAUSER }}
GITEA_PASS: ${{ secrets.GITEAPASS }}
run: | run: |
VERSION=${{ env.VERSION }} echo "Testing network connectivity..."
REPO="${{ github.repository }}" ping -c 2 gitea.kg8.net || echo "ping failed"
curl -v "https://gitea.kg8.net/api/v1/version" 2>&1 | head -20 || echo "curl failed"
echo "Creating release for $VERSION..." - name: Create Release and Upload APK
env:
AUTH: ${{ secrets.AUTHB64 }}
VERSION: ${{ env.VERSION }}
APK_FILE: ${{ env.APK_FILE }}
REPO: ${{ github.repository }}
run: |
echo "Creating release for ${VERSION}..."
# 检查 Release 是否已存在 # 尝试不同的 API endpoint
EXISTING=$(curl -s -u "$GITEA_USER:$GITEA_PASS" "https://gitea.kg8.net/api/v1/repos/$REPO/releases/tags/$VERSION") for API_URL in "https://gitea.kg8.net/api/v1" "http://localhost:3000/api/v1" "http://127.0.0.1:3000/api/v1"; do
RELEASE_ID=$(echo "$EXISTING" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2) echo "Trying: ${API_URL}"
RESPONSE=$(curl -s -X POST "${API_URL}/repos/${REPO}/releases" \
-H "Authorization: Basic ${AUTH}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"${VERSION}\",\"name\":\"Release ${VERSION}\",\"draft\":false,\"prerelease\":false}" \
--connect-timeout 5)
echo "Response: ${RESPONSE}"
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
if [ -n "$RELEASE_ID" ]; then if [ -n "$RELEASE_ID" ]; then
echo "Release 已存在 (ID: $RELEASE_ID),删除旧的..." echo "Release 创建成功 (ID: ${RELEASE_ID}) via ${API_URL}"
curl -s -X DELETE -u "$GITEA_USER:$GITEA_PASS" "https://gitea.kg8.net/api/v1/repos/$REPO/releases/$RELEASE_ID"
sleep 2
fi
# 创建新的 Release # 上传 APK
RESPONSE=$(curl -s -X POST "https://gitea.kg8.net/api/v1/repos/$REPO/releases" \ echo "Uploading APK: ${APK_FILE}"
-u "$GITEA_USER:$GITEA_PASS" \ UPLOAD_RESPONSE=$(curl -s -X POST "${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets" \
-H "Content-Type: application/json" \ -H "Authorization: Basic ${AUTH}" \
-d "{\"tag_name\":\"$VERSION\",\"name\":\"Release $VERSION\",\"draft\":false,\"prerelease\":false}") -F "attachment=@${APK_FILE}")
echo "Response: $RESPONSE" echo "Upload Response: ${UPLOAD_RESPONSE}"
NEW_RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
if [ -z "$NEW_RELEASE_ID" ]; then
echo "❌ Failed to create release"
exit 1
fi
echo "release_id=$NEW_RELEASE_ID" >> $GITHUB_OUTPUT
echo "✅ Release 创建成功 (ID: $NEW_RELEASE_ID)"
- name: Upload APK
env:
GITEA_USER: ${{ secrets.GITEAUSER }}
GITEA_PASS: ${{ secrets.GITEAPASS }}
run: |
echo "Uploading: ${{ env.APK_FILE }}"
ls -lh ${{ env.APK_FILE }}
curl -s -X POST "https://gitea.kg8.net/api/v1/repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.release_id }}/assets" \
-u "$GITEA_USER:$GITEA_PASS" \
-F "attachment=@${{ env.APK_FILE }}"
echo '✅ APK 上传成功!' echo '✅ APK 上传成功!'
exit 0
fi
done
echo "❌ Failed to create release on all endpoints"
exit 1
+1
View File
@@ -4,6 +4,7 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:label="@string/app_name" android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@android:style/Theme.DeviceDefault.Light.NoActionBar"> android:theme="@android:style/Theme.DeviceDefault.Light.NoActionBar">
<activity <activity
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB