Skip to content

Commit

Permalink
action: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
smallprogram committed Oct 3, 2024
1 parent 0cc4f4a commit c129f14
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/Build-OpenWrt_Multi-Platform(V3).yml
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,13 @@ jobs:
chmod +x $ORGANIZE_TAG_SH
$GITHUB_WORKSPACE/$ORGANIZE_TAG_SH "${{ github.token }}" "${{ github.repository }}" "${{ github.run_id }}"
- name: Upload Tags To Artifact
uses: actions/upload-artifact@v4
with:
name: release_tag_final
path: release.txt
retention-days: 5

- name: Upload Release Tag
uses: softprops/[email protected]
if: steps.organize_tags.outputs.status == 'success'
Expand Down
15 changes: 11 additions & 4 deletions compile_script/step07_organize_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ if [ -f "release.txt" ]; then
# 读取release.txt文件内容
cp release.txt "$release_temp_file"
conclusion_success_count=0
# 使用jq解析JSON并提取所需信息
echo "$filtered_jobs" | jq -c '.[]' | while read -r job; do

# 使用进程替换
while IFS= read -r job; do
name=$(echo "$job" | jq -r '.name')
source_platform=$(echo "$name" | cut -d'-' -f2)
platform=$(echo "$name" | cut -d'-' -f3-)
Expand All @@ -46,7 +47,11 @@ if [ -f "release.txt" ]; then
echo "conclusion: $conclusion"
echo "-----------------------------"

conclusion_success_count=$((conclusion_success_count + 1))
if [ "$conclusion" == "success" ]; then
conclusion_success_count=$((conclusion_success_count + 1))
fi

echo "Current count: $conclusion_success_count"

awk -v sp="$source_platform" -v pl="$platform" -v concl="$conclusion" '
{
Expand All @@ -60,7 +65,9 @@ if [ -f "release.txt" ]; then
}
print
}' "$release_temp_file" > temp && mv temp "$release_temp_file"
done
done < <(echo "$filtered_jobs" | jq -c '.[]') # 使用jq解析JSON并提取所需信息

echo "Total success count: $conclusion_success_count"
# 将更新后的内容写回release.txt文件
cp "$release_temp_file" release.txt
sed -i 's/src=""/\&/g' release.txt
Expand Down

0 comments on commit c129f14

Please sign in to comment.