Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

Comments

ci: refactor workflows with extended naming support#33

Merged
mairas merged 7 commits intomainfrom
ci/refactor-workflows-extended-naming
Nov 20, 2025
Merged

ci: refactor workflows with extended naming support#33
mairas merged 7 commits intomainfrom
ci/refactor-workflows-extended-naming

Conversation

@mairas
Copy link
Contributor

@mairas mairas commented Nov 20, 2025

Summary

Refactor GitHub Actions workflows to support extended naming and improve CI/CD structure.

This adopts the improved workflow structure from cockpit-apt, providing better separation of concerns and support for extended naming in package releases.

Changes

  • Create reusable composite actions:
    • build-deb/action.yml: Reusable Debian package building
    • run-tests/action.yml: Reusable test execution
  • Add helper scripts:
    • check-release-exists.sh: Validate release state
    • read-version.sh: Extract version information
    • generate-release-notes.sh: Automated release notes
  • Replace workflows:
    • build.ymlpr.yml (runs tests on PRs)
    • Add main.yml (tests + build + releases)
    • Simplify release.yml
    • Remove release-drafter.yml

Benefits

  • Clear separation between PR checks and main branch builds
  • Reusable actions reduce duplication
  • Foundation for extended naming support
  • Improved maintainability

Test Plan

  • CI will validate workflow syntax
  • PR workflow will run tests
  • Main workflow will build packages

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Adopt improved workflow structure from cockpit-apt:
- Replace build.yml with pr.yml (runs tests on PRs)
- Replace release-drafter.yml with main.yml (tests + build + releases)
- Update release.yml with APT_DISTRO/APT_COMPONENT env vars
- Create composite actions (.github/actions/run-tests, build-deb)
- Add helper scripts (read-version.sh, check-release-exists.sh, generate-release-notes.sh)

Key changes:
- Eliminate parallel builds (reduce CI time ~50%)
- Clear separation of concerns (pr.yml, main.yml, release.yml)
- Extended naming support: packages renamed with +any+haltabs suffix
- Version read from VERSION file
- Build uses arm64 runners for package building

Closes #32

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mairas
Copy link
Contributor Author

mairas commented Nov 20, 2025

Review: CI Workflow Refactoring

Status: ⚠️ Needs Fixes

Issues

1. Wrong product references in release notes 🔴
generate-release-notes.sh references "Cockpit APT" instead of "HALPI2 daemon":

  • Lines 33, 67, 97: Title says "Cockpit APT v${VERSION}"
  • Lines 50-59, 84-87, 108-124: Installation/features describe Cockpit APT

Fix: Replace all Cockpit APT references with HALPI2-daemon content.


2. Missing VERSION file 🔴
read-version.sh reads from VERSION file (line 7), but this file doesn't exist in the repository. Current version is in debian/changelog.

Options:


3. Hardcoded architecture 🟡
main.yml line 52 hardcodes _arm64 - should be determined dynamically if the build supports multiple architectures.


Positive

✅ Good separation: PR checks vs main branch builds
✅ Reusable composite actions reduce duplication
✅ Extended naming support foundation in place
✅ Follows cockpit-apt patterns consistently


Required Actions

  1. Fix all "Cockpit APT" → "HALPI2 daemon" in generate-release-notes.sh
  2. Either add VERSION file or update read-version.sh to parse debian/changelog
  3. Update release notes content to match HALPI2 features/installation

Cannot merge until product references are corrected.

mairas and others added 5 commits November 20, 2025 11:49
- Simplify .bumpversion.cfg to match cockpit-apt pattern
- Add VERSION file as canonical version source
- Fix generate-release-notes.sh to reference HALPI2 daemon instead of Cockpit APT
- Add bumpversion command to run script for version management

Addresses all issues raised in PR #33 review:
1. Fixed all "Cockpit APT" references in release notes
2. Added VERSION file and updated bumpversion config
3. Architecture remains hardcoded to arm64 (acceptable for HALPI2)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Convert all command names from colon-separated (e.g., package:deb)
to hyphen-separated (e.g., package-deb) to match the naming scheme
used in cockpit-apt and other HaLOS repositories.

Changes:
- release:version → release-version
- package:deb → package-deb
- package:deb:only → package-deb-only
- package:deb:docker → package-deb-docker
- package:docker:build → package-docker-build
- ci:check → ci-check
- ci:build → ci-build
- dev:env → dev-env
- dev:version:bump → dev-version-bump
- dev:version:dry-run → dev-version-dry-run
- dev:version:show → dev-version-show
- docker:build → docker-build
- docker:remove → docker-remove

Backward compatibility:
- Added colon-separated aliases for all renamed commands
- Existing scripts and workflows will continue to work

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update from non-existent package:deb:docker:ci to package-deb-docker.

The :ci suffix was incorrect - the command should just be package-deb-docker
which builds the Debian package using the Docker container.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Further simplify command naming to match cockpit-apt patterns:

Command Name Changes:
- release-version → version
- package-deb → build-deb
- package-deb-only → (merged into build-deb)
- package-deb-docker → docker-build-deb
- package-docker-build → build-docker-tools
- dev-version-bump → (removed, use bumpversion directly)
- dev-version-dry-run → bumpversion-dry-run
- dev-version-show → (removed, use version directly)
- docker-build → build-docker
- docker-remove → remove-docker
- uv-download → install-uv

Simplifications:
- Merged package-deb-only into build-deb (simpler structure)
- Changed bumpversion to simple wrapper that forwards all args
- Moved debtools from legacy section to Development Utilities
- Removed all backward compatibility aliases (clean slate)
- Updated .github/actions/build-deb/action.yml to use docker-build-deb

Benefits:
- Consistent verb-noun or action-object naming
- Simpler command structure
- Better alignment with cockpit-apt conventions
- bumpversion now supports all bump2version arguments directly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Resolved conflicts:
- .bumpversion.cfg: Kept simplified config, updated version to 4.0.7
- .github/workflows/build.yml: Removed (replaced by pr.yml and main.yml)
- .github/workflows/release-drafter.yml: Removed (replaced by main.yml)
- .github/workflows/release.yml: Kept our refactored version
- run: Kept our simplified command structure

The refactored CI/CD structure takes precedence over the incremental
fixes added to main. Our version provides a cleaner foundation.
@mairas
Copy link
Contributor Author

mairas commented Nov 20, 2025

Re-Review: All Issues Fixed ✅

Previous Issues - All Resolved

Product references corrected - generate-release-notes.sh now correctly uses "HALPI2 Daemon" instead of "Cockpit APT"

VERSION file exists - Repository has VERSION file (4.0.7) that read-version.sh reads from

Content updated - Release notes now describe HALPI2 features:

  • Blackout reporting, watchdog, RTC sleep mode, USB power control
  • Correct installation instructions (halpid package)

Tests passing - CI checks pass (10s)


Additional Improvements Noticed

✅ Bumpversion config updated (commit=False, tag=False)
run script refactored with cleaner function names
✅ Reusable composite actions properly implemented
✅ Extended naming support foundation in place


Status: APPROVE ✅ - Ready to merge

Great work addressing all the feedback! The workflow refactoring is now complete and correct.

Set commit = True in .bumpversion.cfg to automatically create commits
when bumping versions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mairas mairas merged commit 41b11c0 into main Nov 20, 2025
1 check passed
@mairas mairas deleted the ci/refactor-workflows-extended-naming branch November 20, 2025 11:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant