-
Notifications
You must be signed in to change notification settings - Fork 9
Add Fedora RPM packaging support and improve CI workflows #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Build an RPM package in CI Add RPM package to the release artifacts Closes #40
- Create PACKAGING.md consolidating 5 redundant RPM docs - Add RPM installation section to README.md - Update RELEASE_CHECKLIST.md to be package-agnostic - Delete redundant files: - RPM_GUIDE.md - RPM_AUTOMATION_SUMMARY.md - RPM_BUILD_QUICK_REFERENCE.md - RPM_BUILD_AUTOMATION.md - FEDORA_PACKAGING.md Result: 9 markdown files → 4 markdown files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive RPM packaging support for Fedora Linux and significantly improves the CI/CD workflows by restructuring the release process into separate jobs and adding local CI simulation capabilities.
Key Changes:
- Adds complete RPM packaging infrastructure with spec file, helper scripts, and Makefile targets for building Fedora packages
- Restructures GitHub Actions workflows to use separate jobs for binaries and RPM builds, consolidating everything into the release workflow
- Introduces Docker-based CI simulation scripts for local testing of Ubuntu and Fedora builds
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| mdview.spec | RPM package specification defining build requirements, dependencies, and installation rules |
| build-rpm.sh | Interactive helper script for building RPMs locally with dependency checking and colored output |
| Makefile | Adds RPM build targets (rpm, rpm-local, rpm-setup, rpm-clean) and CI simulation targets with version sanitization |
| .github/workflows/release.yml | Refactored into three jobs (build-binaries, build-rpm, release) for parallel builds and artifact collection |
| .github/workflows/build.yml | Updated to use new version determination logic (though only builds binaries, not RPMs) |
| scripts/ci-sim-ubuntu.sh | CI simulation script for testing Ubuntu builds locally in Docker containers |
| scripts/ci-sim-fedora.sh | CI simulation script for testing Fedora RPM builds locally in Docker containers |
| RPM_GUIDE.md | Comprehensive guide for building and installing RPM packages |
| RPM_BUILD_AUTOMATION.md | Detailed documentation of local and GitHub Actions RPM build automation |
| RPM_BUILD_QUICK_REFERENCE.md | Quick reference for common RPM build commands and workflows |
| RPM_AUTOMATION_SUMMARY.md | High-level summary of the RPM automation system |
| RELEASE_CHECKLIST.md | Step-by-step checklist for releasing new versions with RPM packages |
| FEDORA_PACKAGING.md | Complete guide for Fedora-specific packaging requirements and processes |
| mdview.1.md | Updated version placeholder from hardcoded "1.4.0" to generic "XXX" |
| .gitignore | Added dist/ directory to ignore build artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Makefile
Outdated
| RPM_VERSION=$(shell echo "$(VERSION)" | sed 's/[^A-Za-z0-9.+~_:]/./g') ; \ | ||
| echo "Using RPM version: $$RPM_VERSION (from $(VERSION))" ; \ | ||
| git archive --prefix=mdview-$$RPM_VERSION/ -o $(HOME)/rpmbuild/SOURCES/mdview-$$RPM_VERSION.tar.gz HEAD ; \ | ||
| cp mdview.spec $(HOME)/rpmbuild/SPECS/ ; \ | ||
| rpmbuild -ba -D "_version $$RPM_VERSION" $(HOME)/rpmbuild/SPECS/mdview.spec ; \ | ||
| echo "RPM build complete. Output in $(HOME)/rpmbuild/RPMS/" |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RPM_VERSION sanitization is performed in a shell subshell and is only available within that line. This means the sanitized version is not consistently available for use in subsequent commands like the rpm-local target. Consider exporting RPM_VERSION as a variable that can be reused across targets to ensure consistency between build and copy operations.
| # For manual runs (workflow_dispatch) allow explicit version; otherwise use the ref name | ||
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | ||
| VERSION="${{ github.event.inputs.version }}" |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow checks for workflow_dispatch event but the workflow does not declare workflow_dispatch in its triggers (only push is declared). This means the condition will never be true, and the github.event.inputs.version will never be used. Either add workflow_dispatch to the trigger list or remove this unused conditional logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
build-rpm.sh
Outdated
| echo -e "${RED}Error: Missing dependencies: ${missing[*]}${NC}" | ||
| echo -e "${YELLOW}Install on Fedora:${NC}" | ||
| echo " sudo dnf install -y rpm-build golang pandoc make git" | ||
| exit 1 | ||
| fi |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message lists missing dependencies but doesn't provide clear guidance when the dependency is available but not detected. For example, if rpm-build is installed but the rpmbuild command is not in PATH, users might be confused. Consider checking for the actual command names (like rpmbuild instead of rpm-build) and providing more specific error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
|
|
||
| bin/linux-amd64/mdview: manpage | ||
| env GOOS=linux GOARCH=amd64 go build -ldflags "-X main.appVersion=$(VERSION)" -o ./bin/linux-amd64/mdview | ||
| env GOOS=linux GOARCH=amd64 go build -buildvcs=false -ldflags "-X main.appVersion=$(VERSION)" -o ./bin/linux-amd64/mdview |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -buildvcs=false flag is added to all go build commands. While this is useful for reproducible builds in containerized environments, it removes valuable version control information from the binary. Consider documenting why this flag is necessary or making it conditional based on the build environment (e.g., only in CI or when VCS info is unavailable).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
…rkflow Co-authored-by: mapitman <4205286+mapitman@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Changed from checking package names (rpm-build) to actual commands (rpmbuild) - Added mapping between command names and package names for Fedora - Enhanced error messages to be more specific about missing commands - Added guidance for when packages are installed but commands not in PATH Co-authored-by: mapitman <4205286+mapitman@users.noreply.github.com>
Co-authored-by: mapitman <4205286+mapitman@users.noreply.github.com>
Co-authored-by: mapitman <4205286+mapitman@users.noreply.github.com>
Co-authored-by: mapitman <4205286+mapitman@users.noreply.github.com>
Co-authored-by: mapitman <4205286+mapitman@users.noreply.github.com>
Resolved conflicts in Makefile by combining VERSION_SAFE approach from base branch with corrected tar transform syntax. Changes: - Keep VERSION_SAFE variable definition for sanitizing VERSION - Use VERSION_SAFE in all tar/zip filenames - Use corrected tar transform syntax with proper sed-style delimiters - Merge other changes from fedora-package branch
VERSION_SAFE in Makefile now handles slash sanitization, making the workflow-level sanitization redundant. This approach is cleaner as the Makefile is the single source of truth for filename sanitization. Co-authored-by: mapitman <4205286+mapitman@users.noreply.github.com>
Fix build workflow failures, add workflow_dispatch trigger, and resolve merge conflicts
Changes
RPM Packaging
mdview.spec) for Fedora packagingCI Improvements
rpm-build.ymlworkflow (consolidated into release workflow)Scripts
scripts/ci-sim-ubuntu.shfor local Ubuntu build testingscripts/ci-sim-fedora.shfor local Fedora RPM build testingmake ci-simtargets to simulate CI builds locallyDocumentation
PACKAGING.mdconsolidating all packaging documentation (DEB + RPM)README.mdRELEASE_CHECKLIST.mdto be package-agnosticRelease Artifacts
Release workflow now publishes:
All changes have been tested with a temporary tag and verified that RPMs are correctly built and published as release assets.