Vollautomatisiertes Release-Script für furt mit Forgejo API-Integration #114

Open
opened 2025-09-10 20:27:15 +02:00 by michael · 0 comments
Owner

Ziel

Vollautomatisiertes Release-Script das alle manuellen Schritte ersetzt und über Forgejo API komplette Releases erstellt.

Problem aktuell

  • README.md Updates vergessen (wie bei v0.1.4)
  • 20+ manuelle Schritte pro Release
  • Wiki-Updates mühsam
  • Keine Forgejo Release-Integration
  • Fehleranfällig durch menschliche Faktoren

Lösung: One-Command-Release

Ziel-Workflow:

./scripts/release.sh v0.1.5 "Added sagjan integration support"
# → Kompletter Release automatisch erstellt

Komponenten des Release-Scripts

1. Pre-Release-Validation

# Checks vor Release-Erstellung
- README.md: Version-Referenzen aktuell?
- CHANGELOG.md: Neuer Eintrag vorhanden?
- Tests: SMTP-Delivery funktional?
- Git: Alle Changes committed?
- Wiki: Sync-Status mit main repo

2. Version-Management

# Automatische Version-Updates
- config.lua oder VERSION file
- README.md Beispiele und Download-Links
- CHANGELOG.md Template-basierte Einträge
- Package-Metadaten (falls vorhanden)

3. Git-Workflow-Automation

# Git-Operationen automatisieren
- Automated commit: "prepare release v0.x.y"
- Git tag creation mit Release-Notes
- Push main branch + tags
- Branch/commit validation

4. Wiki-Update-Integration

# furt.wiki Repository-Management
- Clone furt.wiki automatisch
- sed-based version updates (0.1.4 → 0.1.5)
- Auto-commit wiki changes
- Push wiki updates
- Cleanup temporary wiki clone

5. Forgejo API-Integration

# Release-Erstellung via Forgejo API
- POST /api/v1/repos/DAW/furt/releases
- Package-Upload (.tar.gz creation + upload)
- Release-Notes aus CHANGELOG extrahieren
- Asset-Management (binaries, documentation)

6. Package-Creation

# Release-Artefakte erstellen
- Source-Code tar.gz packaging
- Checksum-Generation (SHA256)
- Binary-Builds (falls applicable)
- Documentation-Package

Technische Implementation

Script-Struktur

scripts/release.sh [VERSION] [RELEASE_NOTES]
├── validate_pre_release()
├── bump_version_everywhere()
├── update_documentation()
├── create_git_release()
├── update_wiki_repo()
├── create_packages()
├── upload_to_forgejo()
└── cleanup_temp_files()

Forgejo API-Integration

# API-Endpunkte
POST /api/v1/repos/{owner}/{repo}/releases
POST /api/v1/repos/{owner}/{repo}/releases/{id}/assets

# Authentication
- API-Token aus Environment: FORGEJO_API_TOKEN
- Base64-Authentication für API-Calls

# Release-Data-Structure
{
  "tag_name": "v0.1.5",
  "name": "furt v0.1.5",
  "body": "Auto-extracted from CHANGELOG.md",
  "draft": false,
  "prerelease": false
}

Config-System

# .release-config.json
{
  "repo": "furt",
  "wiki_repo": "furt.wiki",
  "version_files": ["config.lua", "VERSION"],
  "documentation_files": ["README.md", "docs/*.md"],
  "api_base": "https://smida.dragons-at-work.de",
  "package_formats": ["tar.gz"],
  "changelog_format": "markdown"
}

Error-Handling & Rollback

Validation-Failures

# Pre-release checks failed
- Abort with clear error messages
- No changes made to repos
- Suggest fixes for failed validations

Mid-Process-Failures

# Git/API failures during release
- Automatic rollback of git tags
- Cleanup of temporary files
- Restore previous state
- Detailed error logging

Recovery-Options

# Manual recovery commands
./scripts/release.sh --rollback v0.1.5
./scripts/release.sh --retry v0.1.5
./scripts/release.sh --status v0.1.5

Integration in DAW-Ecosystem

Multi-Project-Support

# Template für andere DAW-Projekte
- sagjan, lengan, budlam nutzen gleiches System
- Shared release-library für konsistente Workflows
- Project-specific config overrides

Pipeline-Integration

# werner → walter → Release-Pipeline
- Development testing auf werner
- Package testing auf walter
- Automated release creation
- Production deployment auf tiamat

Deliverables

Phase 1: Core Script

  • release.sh Basis-Implementation
  • Version-Bump-Automatisierung
  • Git-Workflow-Integration
  • Wiki-Update-Mechanismus

Phase 2: Forgejo Integration

  • Forgejo API-Client implementieren
  • Release-Creation via API
  • Asset-Upload-Funktionalität
  • Error-Handling + Rollback

Phase 3: Polish & Documentation

  • Comprehensive error handling
  • User documentation
  • Multi-project templates
  • Testing framework for release process

Success Criteria

Ein Befehl für kompletten Release:

./scripts/release.sh v0.1.5 "Fixed SMTP headers, improved wiki automation"

[INFO] Validating pre-release requirements...  ✓
[INFO] Updating version in all files...        ✓
[INFO] Generating CHANGELOG entry...            ✓
[INFO] Creating git tag v0.1.5...              ✓
[INFO] Updating furt.wiki repository...        ✓
[INFO] Creating release packages...            ✓
[INFO] Uploading to Forgejo via API...         ✓
[INFO] Release v0.1.5 created successfully!   ✓

Release URL: https://smida.dragons-at-work.de/DAW/furt/releases/tag/v0.1.5

Benefits

  • Time-Saving: 30+ Minuten → 2 Minuten
  • Zero-Manual-Steps: Keine vergessenen Updates
  • Konsistenz: Identische Release-Qualität jedes Mal
  • Forgejo-First: Vollständige API-Integration
  • Reusability: Template für alle DAW-Projekte
  • Professional: Production-ready Release-Management

Technical Notes

  • HERE-Document-Pattern: Terminal-safe für komplexe Scripts
  • API-Token-Management: Secure credential handling
  • Multi-Repo-Support: Haupt-Repo + Wiki-Repo synchronisiert
  • Atomic-Operations: Entweder kompletter Erfolg oder vollständiger Rollback
  • Logging: Comprehensive logging für Debugging

Future Extensions

  • Integration mit Package-Repositories (wenn applicable)
  • Automated testing vor Release-Finalisierung
  • Slack/Matrix-Notifications bei Release-Completion
  • Integration mit CI/CD-Pipeline (wenn benötigt)
## Ziel Vollautomatisiertes Release-Script das alle manuellen Schritte ersetzt und über Forgejo API komplette Releases erstellt. ## Problem aktuell - README.md Updates vergessen (wie bei v0.1.4) - 20+ manuelle Schritte pro Release - Wiki-Updates mühsam - Keine Forgejo Release-Integration - Fehleranfällig durch menschliche Faktoren ## Lösung: One-Command-Release **Ziel-Workflow:** ```bash ./scripts/release.sh v0.1.5 "Added sagjan integration support" # → Kompletter Release automatisch erstellt ``` ## Komponenten des Release-Scripts ### 1. Pre-Release-Validation ```bash # Checks vor Release-Erstellung - README.md: Version-Referenzen aktuell? - CHANGELOG.md: Neuer Eintrag vorhanden? - Tests: SMTP-Delivery funktional? - Git: Alle Changes committed? - Wiki: Sync-Status mit main repo ``` ### 2. Version-Management ```bash # Automatische Version-Updates - config.lua oder VERSION file - README.md Beispiele und Download-Links - CHANGELOG.md Template-basierte Einträge - Package-Metadaten (falls vorhanden) ``` ### 3. Git-Workflow-Automation ```bash # Git-Operationen automatisieren - Automated commit: "prepare release v0.x.y" - Git tag creation mit Release-Notes - Push main branch + tags - Branch/commit validation ``` ### 4. Wiki-Update-Integration ```bash # furt.wiki Repository-Management - Clone furt.wiki automatisch - sed-based version updates (0.1.4 → 0.1.5) - Auto-commit wiki changes - Push wiki updates - Cleanup temporary wiki clone ``` ### 5. Forgejo API-Integration ⭐ ```bash # Release-Erstellung via Forgejo API - POST /api/v1/repos/DAW/furt/releases - Package-Upload (.tar.gz creation + upload) - Release-Notes aus CHANGELOG extrahieren - Asset-Management (binaries, documentation) ``` ### 6. Package-Creation ```bash # Release-Artefakte erstellen - Source-Code tar.gz packaging - Checksum-Generation (SHA256) - Binary-Builds (falls applicable) - Documentation-Package ``` ## Technische Implementation ### Script-Struktur ```bash scripts/release.sh [VERSION] [RELEASE_NOTES] ├── validate_pre_release() ├── bump_version_everywhere() ├── update_documentation() ├── create_git_release() ├── update_wiki_repo() ├── create_packages() ├── upload_to_forgejo() └── cleanup_temp_files() ``` ### Forgejo API-Integration ```bash # API-Endpunkte POST /api/v1/repos/{owner}/{repo}/releases POST /api/v1/repos/{owner}/{repo}/releases/{id}/assets # Authentication - API-Token aus Environment: FORGEJO_API_TOKEN - Base64-Authentication für API-Calls # Release-Data-Structure { "tag_name": "v0.1.5", "name": "furt v0.1.5", "body": "Auto-extracted from CHANGELOG.md", "draft": false, "prerelease": false } ``` ### Config-System ```bash # .release-config.json { "repo": "furt", "wiki_repo": "furt.wiki", "version_files": ["config.lua", "VERSION"], "documentation_files": ["README.md", "docs/*.md"], "api_base": "https://smida.dragons-at-work.de", "package_formats": ["tar.gz"], "changelog_format": "markdown" } ``` ## Error-Handling & Rollback ### Validation-Failures ```bash # Pre-release checks failed - Abort with clear error messages - No changes made to repos - Suggest fixes for failed validations ``` ### Mid-Process-Failures ```bash # Git/API failures during release - Automatic rollback of git tags - Cleanup of temporary files - Restore previous state - Detailed error logging ``` ### Recovery-Options ```bash # Manual recovery commands ./scripts/release.sh --rollback v0.1.5 ./scripts/release.sh --retry v0.1.5 ./scripts/release.sh --status v0.1.5 ``` ## Integration in DAW-Ecosystem ### Multi-Project-Support ```bash # Template für andere DAW-Projekte - sagjan, lengan, budlam nutzen gleiches System - Shared release-library für konsistente Workflows - Project-specific config overrides ``` ### Pipeline-Integration ```bash # werner → walter → Release-Pipeline - Development testing auf werner - Package testing auf walter - Automated release creation - Production deployment auf tiamat ``` ## Deliverables ### Phase 1: Core Script - [ ] release.sh Basis-Implementation - [ ] Version-Bump-Automatisierung - [ ] Git-Workflow-Integration - [ ] Wiki-Update-Mechanismus ### Phase 2: Forgejo Integration - [ ] Forgejo API-Client implementieren - [ ] Release-Creation via API - [ ] Asset-Upload-Funktionalität - [ ] Error-Handling + Rollback ### Phase 3: Polish & Documentation - [ ] Comprehensive error handling - [ ] User documentation - [ ] Multi-project templates - [ ] Testing framework for release process ## Success Criteria **Ein Befehl für kompletten Release:** ```bash ./scripts/release.sh v0.1.5 "Fixed SMTP headers, improved wiki automation" [INFO] Validating pre-release requirements... ✓ [INFO] Updating version in all files... ✓ [INFO] Generating CHANGELOG entry... ✓ [INFO] Creating git tag v0.1.5... ✓ [INFO] Updating furt.wiki repository... ✓ [INFO] Creating release packages... ✓ [INFO] Uploading to Forgejo via API... ✓ [INFO] Release v0.1.5 created successfully! ✓ Release URL: https://smida.dragons-at-work.de/DAW/furt/releases/tag/v0.1.5 ``` ## Benefits - **Time-Saving:** 30+ Minuten → 2 Minuten - **Zero-Manual-Steps:** Keine vergessenen Updates - **Konsistenz:** Identische Release-Qualität jedes Mal - **Forgejo-First:** Vollständige API-Integration - **Reusability:** Template für alle DAW-Projekte - **Professional:** Production-ready Release-Management ## Technical Notes - **HERE-Document-Pattern:** Terminal-safe für komplexe Scripts - **API-Token-Management:** Secure credential handling - **Multi-Repo-Support:** Haupt-Repo + Wiki-Repo synchronisiert - **Atomic-Operations:** Entweder kompletter Erfolg oder vollständiger Rollback - **Logging:** Comprehensive logging für Debugging ## Future Extensions - Integration mit Package-Repositories (wenn applicable) - Automated testing vor Release-Finalisierung - Slack/Matrix-Notifications bei Release-Completion - Integration mit CI/CD-Pipeline (wenn benötigt)
michael added the
effort
large
priority
high
status
to-go
type
feature
labels 2025-09-10 20:27:15 +02:00
michael added this to the v0.2.0 - Sagjan Integration milestone 2025-09-10 20:32:36 +02:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DAW/furt#114
No description provided.