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.
Этот коммит содержится в:
Sebastien Larinier 2025-07-23 09:46:17 +02:00
родитель f7cef92067
Коммит bd24073bf1
Не найден ключ, соответствующий данной подписи

33
.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: jobs:
zip-and-commit: zip-and-commit:
# L'action tournera sur un serveur Ubuntu
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Étape 1: Récupère le code de ton dépôt # Étape 1: Récupère le code de ton dépôt
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
# Étape 2: Zippe le répertoire spécifié # Étape de débogage : Lister le contenu pour vérifier le chemin
# L'option -r compresse le dossier et tout son contenu. - 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 - name: Zip the plugin directory
run: | run: |
zip -r "DIMA/plugin/plugin_chrome/fichiers à télécharger/Plugin-dima.zip" "DIMA/plugin/plugin_chrome/fichiers à télécharger/Plugin-dima" # On se place dans le dossier parent pour éviter les problèmes de chemin
cd "DIMA/plugin/plugin_chrome/fichiers à télécharger/"
# Étape 3: Commit et pousse le fichier .zip sur le dépôt # On compresse le dossier "Plugin-dima" dans une archive "Plugin-dima.zip"
# Cette action va créer un nouveau commit avec le fichier zip généré zip -r Plugin-dima.zip Plugin-dima
# Étape 3: Commit et pousse le fichier .zip
- name: Commit and push the zip file - name: Commit and push the zip file
uses: stefanzweifel/git-auto-commit-action@v5 uses: stefanzweifel/git-auto-commit-action@v5
with: with:
# Message du commit qui sera créé par l'action
commit_message: "CI: Auto-generate plugin zip file" 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' file_pattern: 'DIMA/plugin/plugin_chrome/fichiers à télécharger/Plugin-dima.zip'