File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments