@@ -5,13 +5,15 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
tags:
|
||||
- 'v*' # Déclenche la création de release uniquement lors du push d'un tag (ex: v1.0.0)
|
||||
|
||||
jobs:
|
||||
inspect-build-notify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout du code source
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Afficher le chemin du workspace (PWD)
|
||||
run: |
|
||||
@@ -45,24 +47,24 @@ jobs:
|
||||
echo "=========================================="
|
||||
|
||||
- name: Téléverser l'artefact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v3 # v3 est requis pour la compatibilité avec l'API Gitea Actions
|
||||
with:
|
||||
name: projet-build-zip
|
||||
path: mon-projet.zip
|
||||
|
||||
- name: Créer une Release sur Gitea
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: gitea/release-action@v1
|
||||
if: startsWith(github.ref, 'refs/tags/') # S'exécute uniquement si le déclencheur est un tag Git
|
||||
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||
with:
|
||||
state: "published"
|
||||
name: "Release ${{ gitea.ref_name }}"
|
||||
body: |
|
||||
## 📦 Version ${{ gitea.ref_name }}
|
||||
|
||||
Build automatique généré le **$(date)**.
|
||||
Build automatique généré par Gitea Actions.
|
||||
|
||||
### 📝 Détails du déploiement
|
||||
* **Branche source :** `${{ gitea.ref_name }}`
|
||||
* **Branche / Tag :** `${{ gitea.ref_name }}`
|
||||
* **Auteur :** `${{ gitea.actor }}`
|
||||
* **Commit :** `${{ gitea.sha }}`
|
||||
|
||||
@@ -73,7 +75,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Envoyer une notification Telegram
|
||||
if: always()
|
||||
if: always() # Garantit l'envoi du message même en cas d'échec d'une étape
|
||||
uses: appleboy/telegram-action@master
|
||||
with:
|
||||
to: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||||
@@ -82,7 +84,7 @@ jobs:
|
||||
🚀 **Build Gitea Actions terminé !**
|
||||
|
||||
📌 **Dépôt :** [${{ gitea.repository }}](https://git.ericampire.app/${{ gitea.repository }})
|
||||
🌿 **Branche :** ${{ gitea.ref_name }}
|
||||
🌿 **Branche / Tag :** ${{ gitea.ref_name }}
|
||||
👤 **Auteur :** ${{ gitea.actor }}
|
||||
📊 **Statut :** ${{ job.status }}
|
||||
📦 **Artefact généré :** mon-projet.zip
|
||||
Reference in New Issue
Block a user