Skip to content

Commit 5f4a9d4

Browse files
authored
非重要步骤不退出仅报错
1 parent ae69748 commit 5f4a9d4

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

.github/workflows/Build SukiSU Ultra OnePlus.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -588,48 +588,52 @@ jobs:
588588
589589
# 下载 SUSFS 模块(CI)
590590
- name: Download Latest SUSFS Module from CI
591+
continue-on-error: true
591592
run: |
592593
LATEST_RUN_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
593594
"https://api.github.com/repos/sidex15/susfs4ksu-module/actions/runs?status=success" | \
594595
jq -r '.workflow_runs[] | select(.head_branch == "v1.5.2+") | .id' | head -n 1)
595596
596597
if [ -z "$LATEST_RUN_ID" ]; then
597598
echo "No successful run found for branch v1.5.2+"
598-
exit 1
599-
fi
600-
601-
ARTIFACT_URL=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
602-
"https://api.github.com/repos/sidex15/susfs4ksu-module/actions/runs/$LATEST_RUN_ID/artifacts" | jq -r '.artifacts[0].archive_download_url')
599+
else
600+
ARTIFACT_URL=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
601+
"https://api.github.com/repos/sidex15/susfs4ksu-module/actions/runs/$LATEST_RUN_ID/artifacts" | jq -r '.artifacts[0].archive_download_url')
603602
604-
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -o ksu_module_susfs_1.5.2+_CI.zip "$ARTIFACT_URL"
605-
cp ksu_module_susfs_1.5.2+_CI.zip ./AnyKernel3/
603+
if [ -n "$ARTIFACT_URL" ]; then
604+
curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -o ksu_module_susfs_1.5.2+_CI.zip "$ARTIFACT_URL"
605+
cp ksu_module_susfs_1.5.2+_CI.zip ./AnyKernel3/
606+
else
607+
echo "Failed to fetch artifact URL"
608+
fi
609+
fi
606610
607611
608612
# 解压 SukiSU Ultra(CI)(不自动安装)
609613
- name: Download Latest SukiSU-Ultra APK from CI
614+
continue-on-error: true
610615
env:
611616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
612617
run: |
613618
run_id=$(gh api \
614619
"repos/SukiSU-Ultra/SukiSU-Ultra/actions/workflows/build-manager.yml/runs?branch=main&status=success&per_page=1" \
615-
--jq '.workflow_runs[0].id')
620+
--jq '.workflow_runs[0].id' || echo "")
621+
616622
if [[ -z "$run_id" ]]; then
617623
echo "No successful workflow run found."
618-
exit 1
619-
fi
620-
621-
artifact_url=$(gh api \
622-
"repos/SukiSU-Ultra/SukiSU-Ultra/actions/runs/$run_id/artifacts" \
623-
--jq '.artifacts[] | select(.name == "manager") | .archive_download_url')
624+
else
625+
artifact_url=$(gh api \
626+
"repos/SukiSU-Ultra/SukiSU-Ultra/actions/runs/$run_id/artifacts" \
627+
--jq '.artifacts[] | select(.name == "manager") | .archive_download_url')
624628
625-
if [[ -z "$artifact_url" ]]; then
626-
echo "No manager artifact found."
627-
exit 1
629+
if [[ -z "$artifact_url" ]]; then
630+
echo "No manager artifact found."
631+
else
632+
curl -L -H "Authorization: token $GITHUB_TOKEN" -o manager.zip "$artifact_url"
633+
unzip -j manager.zip "*.apk" -d ./AnyKernel3/
634+
fi
628635
fi
629636
630-
curl -L -H "Authorization: token $GITHUB_TOKEN" -o manager.zip "$artifact_url"
631-
unzip -j manager.zip "*.apk" -d ./AnyKernel3/
632-
633637
# 从一加源码中获取适用的 Android 版本信息,注意是系统 Android 版本而非你填写的内核 Android 版本,非一加官方源码可能需要修改或删除这一步
634638
- name: Set zip suffix
635639
id: suffix

0 commit comments

Comments
 (0)