From b9abd511e680f37feeaa842ea995f0f446a108b7 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 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 8eaf02c..b05b1ad 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,7 +50,7 @@ jobs: fi done - API_URL="https://$REGISTRY_USERNAME:$REGISTRY_PASSWORD@$REGISTRY_URL/api/v1/packages/$REGISTRY_USERNAME/pypi/$NAME/$VERSION" + API_URL="https://$DEVPI_URL/$DEVPI_USERNAME/dev/$NAME/$VERSION" STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$API_URL") if [ "$STATUS_CODE" = "404" ]; then @@ -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