Best Practice Github Action Untuk Manjemen Release
1. Struktur Proyek
my-go-api/
βββ .github/
β βββ workflows/
β βββ ci.yml # CI untuk setiap push/PR
β βββ release.yml # Release saat tag dibuat
β βββ tag.yml # Auto-tagging untuk main branch
βββ cmd/
β βββ server/
β βββ main.go # Entry point aplikasi
βββ internal/
β βββ config/ # Konfigurasi aplikasi
β βββ handler/ # HTTP handlers
β βββ middleware/ # Middleware
β βββ version/ # Package untuk version management
β βββ version.go # File version variables
βββ pkg/ # Public packages
β βββ logger/
βββ go.mod # Go modules
βββ go.sum # Go modules checksums
βββ Dockerfile # Docker image build
βββ .dockerignore # File diabaikan Docker build
βββ README.md # Dokumentasi2. Setup Version di Golang
3. Docker Multi-Stage Build
4. .dockerignore
5. GitHub Actions CI Workflow
6. GitHub Actions Release Workflow
7. Semantic Versioning dengan Conventional Commits
8. Workflow untuk Automated Tagging
9. Kapan Membuat Tag Baru - JAWABAN PERTANYAAN UTAMA
β TIDAK, setiap push TIDAK membuat tag baru!
Contoh conventional commits:
Flow kerja:
10. Kapan Harus Release
Release Schedule:
Release Checklist:
11. Environment Variables untuk Build
Development:
Production (GitHub Actions):
12. Best Practices Tambahan
1. Multi-Platform Builds
2. Caching Strategy
3. Security Scanning
4. Slack Notifications
13. Setup Secrets di GitHub
Required Secrets:
Setup Instructions:
14. Contoh Penggunaan Version di Code
15. Testing Setup
Unit Tests:
Integration Tests:
Test Workflow:
Summary Workflow
Development Flow:
Key Points:
Last updated