We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 671725e commit 5662c92Copy full SHA for 5662c92
1 file changed
.github/workflows/publish.yml
@@ -20,4 +20,18 @@ jobs:
20
- run: flutter pub get
21
- run: flutter analyze
22
- run: flutter test
23
- - run: dart pub publish --force
+ - name: Check if version already published
24
+ id: version_check
25
+ run: |
26
+ LOCAL_VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}')
27
+ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://pub.dev/api/packages/libre_location/versions/$LOCAL_VERSION")
28
+ if [ "$HTTP_CODE" = "200" ]; then
29
+ echo "skip=true" >> $GITHUB_OUTPUT
30
+ echo "Version $LOCAL_VERSION already published — skipping"
31
+ else
32
+ echo "skip=false" >> $GITHUB_OUTPUT
33
+ echo "Version $LOCAL_VERSION not yet published — publishing"
34
+ fi
35
+ - name: Publish to pub.dev
36
+ if: steps.version_check.outputs.skip != 'true'
37
+ run: dart pub publish --force
0 commit comments