Skip to content

feat(ci): Add automated GitHub RPM publishing and source tarball packaging workflow #118

@1570005763

Description

@1570005763

Background

Currently, the anolis-lisa project lacks automated CI workflows for:

  1. Building and publishing RPM packages to GitHub Releases
  2. Packaging and distributing source code tarballs

This manual process is error-prone and time-consuming, especially for regular release cycles.

Requirements

1. RPM Package Build & Publish

  • Automatically build RPM packages when a new tag is pushed or release is created
  • Upload RPM artifacts to GitHub Releases
  • Support multiple RPM architectures if needed (x86_64, aarch64, etc.)
  • Generate checksums (SHA256) for released RPM files

2. Source Tarball Packaging

  • Automatically create source code tarballs (.tar.gz) from tagged commits
  • Include all necessary build files and documentation
  • Exclude development-only files (.git, tests, CI configs, etc.)
  • Upload source tarballs to GitHub Releases alongside RPM packages

3. CI Workflow Integration

  • Integrate with existing GitHub Actions CI infrastructure
  • Trigger on:
    • New git tags (recommended: semantic versioning pattern)
    • Manual workflow dispatch for testing
  • Provide workflow status badges in README

4. Release Notes Integration

  • Auto-generate release notes from commit history or PR titles
  • Include changelog summary in GitHub Release description
  • Link to related issues and PRs

Proposed Workflow Structure

name: Release Automation

on:
  push:
    tags:
      - 'v*.*.*'
  workflow_dispatch:

jobs:
  build-rpm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Build RPM
        run: |
          # RPM build commands here
          rpmbuild -ba SPECS/anolisa.spec
      
      - name: Upload RPM to Release
        uses: softprops/action-gh-release@v1
        with:
          files: |
            RPMS/**/*.rpm
            SRPMS/**/*.rpm

  package-source:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Create Source Tarball
        run: |
          git archive --format=tar.gz --prefix=anolisa-${{ github.ref_name }}/ ${{ github.ref_name }} > anolisa-${{ github.ref_name }}.tar.gz
          # Or use custom packaging script if needed
      
      - name: Upload Source Tarball to Release
        uses: softprops/action-gh-release@v1
        with:
          files: anolisa-*.tar.gz

Benefits

  • Consistency: Automated builds ensure reproducible RPM packages
  • Efficiency: Reduces manual effort and potential human errors
  • Traceability: Clear linkage between source code, RPMs, and releases
  • User Experience: Users can easily access both binary and source distributions from GitHub Releases

Additional Context

This automation aligns with industry best practices for open-source RPM-based projects and will improve the overall release quality and developer experience.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions