From bd24073bf1ee09dc19dfd9bbd93c24cce002e903 Mon Sep 17 00:00:00 2001 From: Sebastien Larinier Date: Wed, 23 Jul 2025 09:46:17 +0200 Subject: [PATCH] Automates plugin zip file generation Refactors the zip plugin workflow to correctly zip the plugin directory and commit the generated zip file to the repository. The workflow now changes the working directory before zipping to avoid path issues and includes a debugging step to verify the directory structure. --- .github/workflows/zip-plugin.yml | 33 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/zip-plugin.yml b/.github/workflows/zip-plugin.yml index fc30750..ca1c366 100644 --- a/.github/workflows/zip-plugin.yml +++ b/.github/workflows/zip-plugin.yml @@ -1,34 +1,29 @@ -# Nom du workflow qui apparaîtra dans l'onglet "Actions" de GitHub -name: Zip Plugin Directory - -# Déclencheur : cette action se lancera à chaque push sur la branche "main" -on: - push: - branches: - - main # Tu peux changer "main" par "master" ou une autre branche si besoin - jobs: zip-and-commit: - # L'action tournera sur un serveur Ubuntu runs-on: ubuntu-latest - steps: # Étape 1: Récupère le code de ton dépôt - name: Checkout repository uses: actions/checkout@v4 - # Étape 2: Zippe le répertoire spécifié - # L'option -r compresse le dossier et tout son contenu. + # Étape de débogage : Lister le contenu pour vérifier le chemin + - name: Verify directory path + run: | + echo "Listing contents to find the target directory:" + ls -R + + # Étape 2: Zippe le répertoire - name: Zip the plugin directory run: | - zip -r "DIMA/plugin/plugin_chrome/fichiers à télécharger/Plugin-dima.zip" "DIMA/plugin/plugin_chrome/fichiers à télécharger/Plugin-dima" - - # Étape 3: Commit et pousse le fichier .zip sur le dépôt - # Cette action va créer un nouveau commit avec le fichier zip généré + # On se place dans le dossier parent pour éviter les problèmes de chemin + cd "DIMA/plugin/plugin_chrome/fichiers à télécharger/" + # On compresse le dossier "Plugin-dima" dans une archive "Plugin-dima.zip" + zip -r Plugin-dima.zip Plugin-dima + + # Étape 3: Commit et pousse le fichier .zip - name: Commit and push the zip file uses: stefanzweifel/git-auto-commit-action@v5 with: - # Message du commit qui sera créé par l'action commit_message: "CI: Auto-generate plugin zip file" - # Spécifie le fichier à ajouter au commit + # L'action trouvera automatiquement le nouveau zip dans le bon dossier file_pattern: 'DIMA/plugin/plugin_chrome/fichiers à télécharger/Plugin-dima.zip'