Skip to content

Commit b3fa85b

Browse files
authored
fix: hopefully make this work
1 parent 32b277f commit b3fa85b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,16 @@ jobs:
6666
size=12375230
6767
version=${{ github.run_number }}
6868
download_url=${{ env.catbox_link }}
69-
70-
if [ -n "$download_url" ]; then
69+
70+
current_version=$(jq -r '.apps[0].version' $GITHUB_WORKSPACE/Bbuild/b.json)
71+
echo "Current highest version: $current_version"
72+
73+
if [ -n "$download_url" ] && [ "$version" -gt "$current_version" ]; then
7174
echo "Download URL for .ipa file: $download_url"
7275
echo "Updated at: $updated_at"
7376
echo "Size: $size bytes"
74-
echo "Version: $version"
75-
77+
echo "Version: $version (higher than current $current_version)"
78+
7679
jq --arg version "$version" \
7780
--arg date "$updated_at" \
7881
--argjson size "$size" \
@@ -89,10 +92,10 @@ jobs:
8992
downloadURL: $url
9093
}] + .apps[0].versions
9194
) | .apps[0].versions |= unique_by(.version)' $GITHUB_WORKSPACE/Bbuild/b.json > $GITHUB_WORKSPACE/Bbuild/updated_b.json
92-
95+
9396
mv $GITHUB_WORKSPACE/Bbuild/updated_b.json $GITHUB_WORKSPACE/Bbuild/b.json
9497
else
95-
echo "missing information."
98+
echo "Version $version is not greater than the current version $current_version or missing information."
9699
echo "Updated at: $updated_at"
97100
echo "Version: $version"
98101
fi

0 commit comments

Comments
 (0)