Skip to content

Commit

Permalink
[release] Check if packages are ready with 'pip index versions'
Browse files Browse the repository at this point in the history
This commit updates the release workflow. Now it will check if the
package is ready with 'pip index versions' instead of trying to install
the package.

Signed-off-by: Jose Javier Merchante <jjmerchante@bitergia.com>
  • Loading branch information
jjmerchante committed Sep 9, 2022
1 parent ed5ae6b commit 515918e
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/release-grimoirelab-component.yml
Expand Up @@ -259,14 +259,29 @@ jobs:
shell: bash
if: steps.wait-for-release.outcome == 'success'
run: |
package="${{ inputs.module_name }}==${{ steps.version.outputs.version }}"
package="${{ inputs.module_name }}"
version="${{ steps.version.outputs.version }}"
# Format version 1.2.3-rc.1 to 1.2.3rc1
versionNum=${version%-*}
versionRC=${version#$versionNum}
versionRC=${versionRC//[-.]/}
currentVersion="${versionNum}${versionRC}"
while true
pip install --upgrade pip
for i in $(seq 20)
do
pip install $package && break
pipVersion=$(pip index versions --pre $package 2>/dev/null | head -n 1 | cut -f2 -d '(' | cut -f1 -d ')')
echo "$currentVersion $pipVersion"
if [ "$pipVersion" = "$currentVersion" ]
then
echo "Same version"
exit 0
fi
echo "Wait for PyPI..."
sleep 10
echo "Wait..."
done
echo "Latest version doesn't match after several retries"
exit 1
- id: rollback
name: Rollback last commit and remove tag
Expand Down

0 comments on commit 515918e

Please sign in to comment.