Skip to content

Commit 7734eae

Browse files
committed
chore: Replace custom package publishing script with a single melos publish command.
1 parent d7f665a commit 7734eae

1 file changed

Lines changed: 1 addition & 40 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -56,43 +56,4 @@ jobs:
5656
done
5757
5858
- name: Publish packages
59-
env:
60-
RELEASE_TAG: ${{ github.ref_name }}
61-
run: |
62-
TAG_VERSION="${RELEASE_TAG#v}"
63-
64-
is_already_published() {
65-
package_name="$1"
66-
curl -fsSL "https://pub.dev/api/packages/$package_name" | grep -Eq "\"version\"[[:space:]]*:[[:space:]]*\"$TAG_VERSION\""
67-
}
68-
69-
publish_package() {
70-
package_path="$1"
71-
package_name="$2"
72-
73-
if is_already_published "$package_name"; then
74-
echo "$package_name $TAG_VERSION is already on pub.dev, skipping."
75-
return 0
76-
fi
77-
78-
for attempt in 1 2 3; do
79-
echo "Publishing $package_name (attempt $attempt)..."
80-
if (cd "$package_path" && flutter pub publish --force); then
81-
echo "$package_name published."
82-
return 0
83-
fi
84-
85-
if [ "$attempt" -lt 3 ]; then
86-
echo "Retrying $package_name in 60s..."
87-
sleep 60
88-
fi
89-
done
90-
91-
echo "Failed to publish $package_name after 3 attempts."
92-
return 1
93-
}
94-
95-
publish_package packages/survey_kit survey_kit
96-
publish_package packages/survey_kit_audio survey_kit_audio
97-
publish_package packages/survey_kit_lottie survey_kit_lottie
98-
publish_package packages/survey_kit_video survey_kit_video
59+
run: melos publish --no-dry-run

0 commit comments

Comments
 (0)