Switch from gitea to devpi
All checks were successful
/ 🐍 Build & Publish Python Packages (push) Successful in 12s
All checks were successful
/ 🐍 Build & Publish Python Packages (push) Successful in 12s
This commit is contained in:
@ -16,9 +16,8 @@ jobs:
|
||||
- name: 🔍 Sélectionner les projets à publier
|
||||
id: detect
|
||||
env:
|
||||
REGISTRY_URL: ${{ vars.REGISTRY_URL }}
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
DEVPI_URL: ${{ vars.DEVPI_URL }}
|
||||
DEVPI_USERNAME: ${{ secrets.DEVPI_USERNAME }}
|
||||
run: |
|
||||
set +e # Ne pas interrompre le script en cas d'erreur
|
||||
git fetch origin master --depth=2 || true
|
||||
@ -51,8 +50,8 @@ jobs:
|
||||
fi
|
||||
done
|
||||
|
||||
API_URL="https://$REGISTRY_USERNAME:$REGISTRY_PASSWORD@$REGISTRY_URL/api/v1/packages/$REGISTRY_USERNAME/pypi/$NAME/$VERSION"
|
||||
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$API_URL")
|
||||
API_URL="https://$DEVPI_URL/$DEVPI_USERNAME/dev/$NAME/$VERSION"
|
||||
STATUS_CODE=$(curl -L -s -o /dev/null -w "%{http_code}" "$API_URL")
|
||||
|
||||
if [ "$STATUS_CODE" = "404" ]; then
|
||||
echo "📦 $NAME version $VERSION n'existe pas (HTTP $STATUS_CODE)"
|
||||
@ -73,18 +72,18 @@ jobs:
|
||||
- name: 🚀 Publier les projets sélectionnés
|
||||
if: steps.detect.outputs.selected_projects != ''
|
||||
env:
|
||||
REGISTRY_URL: ${{ vars.REGISTRY_URL }}
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
DEVPI_URL: ${{ vars.DEVPI_URL }}
|
||||
DEVPI_USERNAME: ${{ secrets.DEVPI_USERNAME }}
|
||||
DEVPI_PASSWORD: ${{ secrets.DEVPI_PASSWORD }}
|
||||
run: |
|
||||
for dir in ${{ steps.detect.outputs.selected_projects }}; do
|
||||
echo "🚀 Publication de $dir"
|
||||
cd "$dir"
|
||||
python3 setup.py sdist
|
||||
twine upload \
|
||||
--repository-url https://$REGISTRY_URL/api/packages/$REGISTRY_USERNAME/pypi \
|
||||
-u "$REGISTRY_USERNAME" \
|
||||
-p "$REGISTRY_PASSWORD" \
|
||||
--repository-url https://$DEVPI_URL/$DEVPI_USERNAME/dev \
|
||||
-u "$DEVPI_USERNAME" \
|
||||
-p "$DEVPI_PASSWORD" \
|
||||
dist/* || exit 1
|
||||
cd -
|
||||
done
|
||||
|
Reference in New Issue
Block a user