Skip to content

Commit 2e67027

Browse files
committed
workflow: fix telegram push debug version
1 parent ec2354b commit 2e67027

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,24 @@ jobs:
138138
COMMIT_ID: ${{ github.event.head_commit.id }}
139139
run: |
140140
if [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
141-
for APK_FILE in "${{ steps.sign_release_app.outputs.signedReleaseFile }}" "${{ steps.sign_debug_app.outputs.signedReleaseFile }}"
142-
do
143-
if [ -f "$APK_FILE" ]; then
144-
FILENAME=$(basename "$APK_FILE")
145-
for GROUP_ID in "-1002058433411" "-1001910818234"
146-
do
147-
URL=$(python3 .github/scripts/telegram_url.py $GROUP_ID)
148-
curl -v "$URL" -F document=@"$APK_FILE" -F caption="$FILENAME"
149-
done
150-
fi
141+
OUTPUT_DIRS=(
142+
"app/build/outputs/apk/release"
143+
"app/build/outputs/apk/debug"
144+
)
145+
for OUTPUT_DIR in "${OUTPUT_DIRS[@]}"; do
146+
if [ -d "$OUTPUT_DIR" ]; then
147+
# 查找APK文件
148+
APK_FILE=$(find "$OUTPUT_DIR" -name "*.apk" | head -n 1)
149+
150+
if [ ! -z "$APK_FILE" ] && [ -f "$APK_FILE" ]; then
151+
echo "Found APK: $APK_FILE"
152+
153+
for GROUP_ID in "-1002058433411" "-1001910818234"; do
154+
URL=$(python3 .github/scripts/telegram_url.py $GROUP_ID)
155+
curl -v "$URL" -F Release=@"$APK_FILE"
156+
done
157+
fi
158+
fi
151159
done
152160
fi
153161

0 commit comments

Comments
 (0)