Skip to content

CI: Automate GitHub release workflow #125

@senomorf

Description

@senomorf

Objective

Implement automated GitHub release workflow with changelog generation, asset creation, and semantic versioning to formalize LoadShaper release process.

Current State

Manual release process:

  • No automated release creation
  • No standardized changelog generation
  • Manual version management
  • No release asset automation
  • Inconsistent release documentation

Strong foundation exists:

  • ✅ Automated Docker builds and publishing
  • ✅ Security scanning and image signing infrastructure
  • ✅ Comprehensive Helm charts ready for packaging

Target State

Automated release workflow:

  • GitHub releases created automatically from git tags
  • Generated changelogs from commit history
  • Release assets (container manifests, Helm charts)
  • Semantic versioning integration
  • Consistent release documentation

Implementation Approach

Depends On:

Release Automation Workflow

New workflow file (.github/workflows/release.yml):

name: Release

on:
  push:
    tags: ["v*.*.*"]

jobs:
  create-release:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      packages: write
      
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Full history for changelog
          
      - name: Validate semantic version tag
        run: |
          if [[ ! "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
            echo "Tag must follow semantic versioning: v1.2.3"
            exit 1
          fi
          
      - name: Generate changelog
        id: changelog
        run: |
          PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "Initial release")
          echo "## Changes since ${PREVIOUS_TAG}" > CHANGELOG.md
          echo "" >> CHANGELOG.md
          
          # Categorize commits by type
          git log --pretty=format:"%s (%h)" ${PREVIOUS_TAG}..HEAD | while read -r line; do
            case "$line" in
              feat*|add*) echo "### ✨ New Features" ;;
              fix*) echo "### 🐛 Bug Fixes" ;;
              perf*) echo "### ⚡ Performance" ;;
              refactor*) echo "### 🔨 Refactoring" ;;
              docs*) echo "### 📝 Documentation" ;;
              test*) echo "### 🧪 Testing" ;;
              ci*|build*) echo "### 🔧 Build & CI" ;;
              *) echo "### 🔄 Other Changes" ;;
            esac
            echo "- $line"
            echo ""
          done >> CHANGELOG.md
          
      - name: Build release Docker images
        uses: docker/build-push-action@v5
        with:
          context: .
          platforms: linux/amd64,linux/arm64
          push: true
          tags: |
            senomorf/loadshaper:${{ github.ref_name }}
            senomorf/loadshaper:latest
            
      - name: Generate container manifest
        run: |
          docker buildx imagetools inspect senomorf/loadshaper:${{ github.ref_name }} > container-manifest.txt
          
      - name: Package Helm chart
        run: |
          # Create Helm package for release
          helm package helm/loadshaper --version ${{ github.ref_name }} --app-version ${{ github.ref_name }}
          
      - name: Create GitHub release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: ${{ github.ref_name }}
          release_name: LoadShaper ${{ github.ref_name }}
          body_path: CHANGELOG.md
          draft: false
          prerelease: false
          
      - name: Upload release assets
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: container-manifest.txt
          asset_name: container-manifest.txt
          asset_content_type: text/plain

Version Management

Manual Tagging Process (simple approach):

# Create and push semantic version tag
git tag -a "v2.3.0" -m "Release v2.3.0"
git push origin v2.3.0

# Workflow automatically creates release

Optional: Automated Version Bumping (future enhancement):

# Manual workflow dispatch for version bumping
name: Bump Version
on:
  workflow_dispatch:
    inputs:
      bump_type:
        description: 'Version bump type'
        required: true
        default: 'patch'
        type: choice
        options: [patch, minor, major]

Release Asset Strategy

Container Images

  • Multi-platform images: Built and published for amd64/arm64
  • Signed images: All release images signed with Cosign
  • Manifest: Container platform details and signatures

Helm Charts

  • Packaged charts: Versioned Helm packages for easy deployment
  • Values examples: Production-ready value files included
  • Documentation: Chart README with deployment guidance

Release Documentation

  • Generated changelog: Automatic categorization from commit messages
  • Breaking changes: Highlighted compatibility notes
  • Upgrade guidance: Migration steps for version updates

Why Automated Releases Matter

Professional Project Management

  • Formal releases: Clear versioning and release notes
  • Predictable updates: Users know when and what changed
  • Asset distribution: Easy access to release artifacts
  • Release history: Clear project evolution timeline

User Experience

  • Semantic versioning: Predictable compatibility and update impact
  • Release notes: Clear understanding of changes and improvements
  • Asset availability: Easy access to specific version artifacts
  • Upgrade guidance: Smooth update experience

Development Process

  • Release discipline: Encourages quality and testing before releases
  • Changelog automation: Reduces manual documentation burden
  • Version management: Clear project progression and milestones
  • Distribution automation: Consistent release artifact creation

Success Criteria

Release Automation

  • GitHub releases created automatically from semantic version tags
  • Changelog generated from commit history with categorization
  • Container images built and published for releases
  • Release assets (manifests, charts) attached correctly

Version Management

  • Semantic versioning enforced (v1.2.3 format)
  • Release tags trigger workflow correctly
  • Version consistency across artifacts
  • Clear upgrade path documentation

Asset Quality

  • Multi-platform container images in releases
  • Signed images for supply chain security
  • Packaged Helm charts with correct versioning
  • Complete container manifests and metadata

Documentation

  • Generated changelogs categorize changes properly
  • Breaking changes highlighted clearly
  • Release notes provide actionable information
  • Upgrade instructions included when needed

Integration Points

CI/CD Pipeline

Project Management

  • Formalizes: Release process and versioning
  • Enables: Predictable update cycle
  • Supports: Enterprise adoption with formal releases

Changelog Generation Strategy

Commit Message Categories

feat: New features (✨)
fix: Bug fixes (🐛)
perf: Performance improvements (⚡)
refactor: Code refactoring (🔨)
docs: Documentation updates (📝)
test: Testing changes (🧪)
ci/build: Build and CI changes (🔧)
other: Miscellaneous changes (🔄)

Breaking Changes

  • Detection: Look for "BREAKING CHANGE:" in commit messages
  • Highlighting: Special section in changelog
  • Documentation: Clear upgrade impact explanation

Related Issues

Testing Requirements

Release Process

  • Test release creation with semantic version tags
  • Validate changelog generation accuracy
  • Verify asset creation and attachment
  • Test release workflow with different commit types

Version Management

  • Semantic version validation works correctly
  • Invalid tags rejected appropriately
  • Release artifacts match version correctly
  • Upgrade documentation accurate

Integration

  • Release workflow integrates with existing CI
  • Docker builds trigger correctly for releases
  • Image signing works for release images
  • Helm charts package correctly

Priority: P3-defer - Nice-to-have for project formalization but not critical
Effort: Medium - Standard release automation with changelog generation
Value: Medium - Improves project professionalism and user experience

Metadata

Metadata

Assignees

No one assigned

    Labels

    automated-testingMeta-label for automated testing pipeline issuescategory: infrastructureInfrastructure, deployment, and ops-related issuesci-cdCI/CD automation taskscontainerDocker, security, deploymentdocumentationDocs and guidesenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions