Compare commits
4 Commits
96f28cf302
...
c122d54979
Author | SHA1 | Date | |
---|---|---|---|
c122d54979 | |||
807ef11509 | |||
002d2266d7 | |||
acb5bec42c |
98
.gitea/workflows/publish.yml
Normal file
98
.gitea/workflows/publish.yml
Normal file
@ -0,0 +1,98 @@
|
||||
name: Build & Publish Python Packages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 📦 Cloner le dépôt
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 🔧 Installer les outils Python
|
||||
run: |
|
||||
python3 -m pip install --break-system-packages setuptools wheel twine
|
||||
|
||||
- name: 🔍 Sélectionner les projets à publier
|
||||
id: detect
|
||||
env:
|
||||
REGISTRY_URL: ${{ vars.REGISTRY_URL }}
|
||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
DEBUG: true
|
||||
run: |
|
||||
set +e # Ne pas interrompre le script en cas d'erreur
|
||||
git fetch origin master --depth=2 || true
|
||||
CHANGED=$(git diff --name-only HEAD~1 HEAD || echo "")
|
||||
|
||||
[ "$DEBUG" = true ] && echo "🔍 Fichiers modifiés: $CHANGED"
|
||||
|
||||
SELECTED=""
|
||||
for dir in */; do
|
||||
if [ ! -f "$dir/setup.py" ]; then
|
||||
[ "$DEBUG" = true ] && echo "⏭️ $dir ignoré (pas de setup.py)"
|
||||
continue
|
||||
fi
|
||||
|
||||
NAME=$(cd "$dir" && python3 setup.py --name 2>/dev/null)
|
||||
VERSION=$(cd "$dir" && python3 setup.py --version 2>/dev/null)
|
||||
if [ -z "$NAME" ]; then
|
||||
[ "$DEBUG" = true ] && echo "⚠️ Aucun nom récupéré pour $dir"
|
||||
continue
|
||||
fi
|
||||
|
||||
SHOULD_INCLUDE=0
|
||||
|
||||
for f in $CHANGED; do
|
||||
if [[ "$f" == "$dir"* ]]; then
|
||||
[ "$DEBUG" = true ] && echo "🟡 Modification détectée dans $dir"
|
||||
SHOULD_INCLUDE=$((SHOULD_INCLUDE + 1))
|
||||
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")
|
||||
|
||||
if [ "$STATUS_CODE" = "404" ]; then
|
||||
[ "$DEBUG" = true ] && echo "📦 $NAME version $VERSION n'existe pas (HTTP $STATUS_CODE)"
|
||||
SHOULD_INCLUDE=$((SHOULD_INCLUDE + 1))
|
||||
else
|
||||
[ "$DEBUG" = true ] && echo "🔄 $NAME version $VERSION déjà présente (HTTP $STATUS_CODE)"
|
||||
fi
|
||||
|
||||
if [ "$SHOULD_INCLUDE" -eq 2 ]; then
|
||||
SELECTED+="$dir "
|
||||
fi
|
||||
done
|
||||
|
||||
echo "selected_projects=$SELECTED" >> $GITHUB_OUTPUT
|
||||
echo "✅ Projets sélectionnés: $SELECTED"
|
||||
|
||||
|
||||
- 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 }}
|
||||
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" \
|
||||
dist/* || exit 1
|
||||
cd -
|
||||
done
|
||||
|
||||
- name: ✅ Aucun projet à publier
|
||||
if: steps.detect.outputs.selected_projects == ''
|
||||
run: echo "✅ Aucun projet modifié ou nouveau. Rien à publier."
|
@ -1,7 +1,7 @@
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='HandBrake_recursive',
|
||||
name='HandBrake-recursive',
|
||||
version='0.1.0',
|
||||
description='Un script pour traiter les fichiers vidéo avec HandBrake de manière récursive.',
|
||||
py_modules=['HandBrake_recursive'],
|
||||
|
26
README.md
26
README.md
@ -35,9 +35,7 @@ pipx ensurepath
|
||||
Un outil pour encoder des vidéos de manière récursive en utilisant HandBrake. Il permet de traiter des fichiers vidéo dans un répertoire donné, en utilisant des presets définis pour le transcodage. Il génère également un résumé des opérations effectuées dans un fichier Excel.
|
||||
|
||||
```bash
|
||||
git clone https://git.netdldata.net/lionel/ProjetsPython.git
|
||||
cd ProjetsPython/HandBrake_recursive
|
||||
pipx install .
|
||||
pipx install --pip-args="--extra-index-url https://git.netdldata.net/api/packages/lionel/pypi/simple/" HandBrake-recursive
|
||||
```
|
||||
|
||||
### proxmox_export_disk
|
||||
@ -45,9 +43,7 @@ pipx install .
|
||||
Un script pour exporter des informations sur les disques depuis Proxmox. Il récupère les détails des disques des machines virtuelles et des conteneurs sur un serveur Proxmox, et exporte ces informations dans un fichier Excel ou ODS.
|
||||
|
||||
```bash
|
||||
git clone https://git.netdldata.net/lionel/ProjetsPython.git
|
||||
cd ProjetsPython/proxmox_export_disk
|
||||
pipx install .
|
||||
pipx install --pip-args="--extra-index-url https://git.netdldata.net/api/packages/lionel/pypi/simple/" proxmox-export-disk
|
||||
```
|
||||
|
||||
### tree_stream
|
||||
@ -55,9 +51,7 @@ pipx install .
|
||||
Un utilitaire pour afficher la structure des répertoires sous forme de flux. Il permet de visualiser l'arborescence des fichiers et des dossiers avec des informations supplémentaires sur les fichiers vidéo, comme les flux et les chapitres.
|
||||
|
||||
```bash
|
||||
git clone https://git.netdldata.net/lionel/ProjetsPython.git
|
||||
cd ProjetsPython/tree_stream
|
||||
pipx install .
|
||||
pipx install --pip-args="--extra-index-url https://git.netdldata.net/api/packages/lionel/pypi/simple/" tree-stream
|
||||
```
|
||||
|
||||
### multiplex
|
||||
@ -66,17 +60,5 @@ Un script Python pour assembler des pistes vidéo, audio et sous-titres issues d
|
||||
Il gère la priorité des pistes françaises, la définition des pistes par défaut, la gestion des chapitres et le renommage intelligent des pistes.
|
||||
|
||||
```bash
|
||||
git clone https://git.netdldata.net/lionel/ProjetsPython.git
|
||||
cd ProjetsPython/multiplex
|
||||
pipx install .
|
||||
```
|
||||
|
||||
### Installer tous les projets
|
||||
|
||||
```bash
|
||||
git clone https://git.netdldata.net/lionel/ProjetsPython.git
|
||||
cd ProjetsPython
|
||||
for dir in */; do
|
||||
(cd "$dir" && pipx install .)
|
||||
done
|
||||
pipx install --pip-args="--extra-index-url https://git.netdldata.net/api/packages/lionel/pypi/simple/" multiplex
|
||||
```
|
||||
|
3
multiplex/.gitignore
vendored
Normal file
3
multiplex/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
build
|
||||
multiplex.egg-info
|
||||
.venv
|
@ -1,7 +1,7 @@
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name='proxmox_export_disk',
|
||||
name='proxmox-export-disk',
|
||||
version='0.1.0',
|
||||
description='Un script pour récupérer l\'utilisation des disques des VMs dans Proxmox.',
|
||||
py_modules=['proxmox_export_disk'],
|
||||
|
@ -1,7 +1,7 @@
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name="tree_stream",
|
||||
name="tree-stream",
|
||||
version="0.1.0",
|
||||
description="Affiche une arborescence enrichie des fichiers vidéo avec chapitres et flux",
|
||||
author="TonNom",
|
||||
|
Reference in New Issue
Block a user