Skip to content

Commit c364174

Browse files
Skip already published packages
1 parent cff4062 commit c364174

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/scripts/publish-packages.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ PACKAGES="$@"
1010

1111
for pkg in $PACKAGES; do
1212
echo "::group::Publishing $pkg"
13+
14+
# Check if version already exists on pub.dev
15+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://pub.dev/api/packages/$pkg/versions/$VERSION")
16+
if [ "$HTTP_CODE" = "200" ]; then
17+
echo "$pkg $VERSION already published, skipping"
18+
echo "::endgroup::"
19+
continue
20+
fi
21+
1322
cd packages/$pkg
1423
dart pub get
1524
dart pub publish --force

0 commit comments

Comments
 (0)