From b57c0117e47dca74451f8a5f5a934e8f0a15f3e8 Mon Sep 17 00:00:00 2001 From: lionel <.> Date: Thu, 24 Jul 2025 18:29:09 +0200 Subject: [PATCH] Switch from gitea to devpi --- .gitea/workflows/publish.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 8eaf02c..098785a 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -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