File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -103,25 +103,28 @@ jobs:
103
103
env :
104
104
VERSION : ${{ env.VERSION }}
105
105
run : |
106
- # Wait for package to be available (try up to 30 times with 20s delay - total 10 minutes)
107
106
for i in {1..30}; do
108
- if curl -s -f https://test.pypi.org/pypi/socketsecurity/$VERSION/json > /dev/null; then
109
- echo "Package ${VERSION} is now available on Test PyPI"
107
+ if pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==${VERSION}; then
108
+ echo "Package ${VERSION} is now available and installable on Test PyPI"
109
+ pip uninstall -y socketsecurity
110
+ echo "success=true" >> $GITHUB_OUTPUT
110
111
exit 0
111
112
fi
112
- echo "Attempt $i: Package not yet available , waiting 20s... (${i}/30)"
113
+ echo "Attempt $i: Package not yet installable , waiting 20s... (${i}/30)"
113
114
sleep 20
114
115
done
115
- echo "Package ${VERSION} not available after 10 minutes"
116
+ echo "success=false" >> $GITHUB_OUTPUT
116
117
exit 1
117
118
118
119
- name : Login to Docker Hub
120
+ if : steps.verify_package.outputs.success == 'true'
119
121
uses : docker/login-action@v3
120
122
with :
121
123
username : ${{ secrets.DOCKERHUB_USERNAME }}
122
124
password : ${{ secrets.DOCKERHUB_TOKEN }}
123
125
124
126
- name : Build & Push Docker Preview
127
+ if : steps.verify_package.outputs.success == 'true'
125
128
uses : docker/build-push-action@v5
126
129
env :
127
130
VERSION : ${{ env.VERSION }}
You can’t perform that action at this time.
0 commit comments