Skip to content

Commit f05bb92

Browse files
Automate Publishing All Packages (#11)
1 parent d4394d5 commit f05bb92

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/publish-packages.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
env:
4747
VERSION: ${{ steps.version.outputs.VERSION }}
4848
run: |
49-
if curl -s "https://pub.dev/api/packages/dart_node_core/versions/$VERSION" | grep -q '"version"'; then
49+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "https://pub.dev/api/packages/dart_node_core/versions/$VERSION")
50+
if [ "$RESPONSE" = "200" ]; then
5051
echo "dart_node_core $VERSION already exists on pub.dev, skipping..."
5152
else
5253
cd packages/dart_node_core
@@ -74,7 +75,8 @@ jobs:
7475
env:
7576
VERSION: ${{ steps.version.outputs.VERSION }}
7677
run: |
77-
if curl -s "https://pub.dev/api/packages/dart_node_express/versions/$VERSION" | grep -q '"version"'; then
78+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "https://pub.dev/api/packages/dart_node_express/versions/$VERSION")
79+
if [ "$RESPONSE" = "200" ]; then
7880
echo "dart_node_express $VERSION already exists on pub.dev, skipping..."
7981
else
8082
cd packages/dart_node_express
@@ -86,7 +88,8 @@ jobs:
8688
env:
8789
VERSION: ${{ steps.version.outputs.VERSION }}
8890
run: |
89-
if curl -s "https://pub.dev/api/packages/dart_node_ws/versions/$VERSION" | grep -q '"version"'; then
91+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "https://pub.dev/api/packages/dart_node_ws/versions/$VERSION")
92+
if [ "$RESPONSE" = "200" ]; then
9093
echo "dart_node_ws $VERSION already exists on pub.dev, skipping..."
9194
else
9295
cd packages/dart_node_ws
@@ -98,7 +101,8 @@ jobs:
98101
env:
99102
VERSION: ${{ steps.version.outputs.VERSION }}
100103
run: |
101-
if curl -s "https://pub.dev/api/packages/dart_node_react/versions/$VERSION" | grep -q '"version"'; then
104+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "https://pub.dev/api/packages/dart_node_react/versions/$VERSION")
105+
if [ "$RESPONSE" = "200" ]; then
102106
echo "dart_node_react $VERSION already exists on pub.dev, skipping..."
103107
else
104108
cd packages/dart_node_react
@@ -126,7 +130,8 @@ jobs:
126130
env:
127131
VERSION: ${{ steps.version.outputs.VERSION }}
128132
run: |
129-
if curl -s "https://pub.dev/api/packages/dart_node_react_native/versions/$VERSION" | grep -q '"version"'; then
133+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "https://pub.dev/api/packages/dart_node_react_native/versions/$VERSION")
134+
if [ "$RESPONSE" = "200" ]; then
130135
echo "dart_node_react_native $VERSION already exists on pub.dev, skipping..."
131136
else
132137
cd packages/dart_node_react_native

0 commit comments

Comments
 (0)