Adopt shared actions for release packaging#106
Conversation
Reviewer's GuideThis PR replaces the GoReleaser-based release workflow with a matrix-driven GitHub Actions pipeline that leverages shared composite actions for building and packaging, updates test detection logic, refreshes documentation to describe the new process, and adds build scripts and static man pages to stage documentation into packages. Sequence diagram for the new release packaging pipelinesequenceDiagram
participant GitHubActions
participant RustBuildRelease
participant LinuxPackages
participant SoftpropsGHRelease
GitHubActions->>RustBuildRelease: Build binaries (comenq, comenqd)
RustBuildRelease->>RustBuildRelease: Stage static man pages
RustBuildRelease->>LinuxPackages: Generate nfpm manifest & package
LinuxPackages->>GitHubActions: Return .deb/.rpm packages
GitHubActions->>SoftpropsGHRelease: Upload packages
SoftpropsGHRelease->>GitHubActions: Create draft GitHub Release
Class diagram for new build.rs scripts in client and daemon cratesclassDiagram
class BuildScriptComenq {
+main()
-copy_man_page() std::io::Result<()>
}
class BuildScriptComenqd {
+main()
-copy_man_page() std::io::Result<()>
}
BuildScriptComenq : main() calls copy_man_page()
BuildScriptComenqd : main() calls copy_man_page()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Summary by CodeRabbit
WalkthroughReplace GoReleaser with a matrix-based Linux packaging workflow using shared actions and nfpm. Add build scripts to stage man pages for Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions
participant Builder as rust-build-release
participant NFPM as nfpm
participant GHRel as action-gh-release
Dev->>GH: Push tag (vX.Y.Z)
activate GH
GH->>GH: build-packages (matrix: {bin, arch, target})
rect rgba(200,230,255,0.3)
note right of GH: Prepare RELEASE_VERSION, clean dist
GH->>Builder: Setup toolchain & build --release
Builder-->>GH: Binaries per matrix
GH->>GH: Generate nfpm.yaml (bin-specific)
GH->>NFPM: Package .deb and .rpm
NFPM-->>GH: Artefacts (${bin}-${arch})
GH->>GH: Upload artefacts
end
GH->>GH: release (needs: build-packages)
GH->>GH: Download artefacts
GH->>GHRel: Create draft release, attach packages
deactivate GH
sequenceDiagram
autonumber
participant Cargo as cargo build
participant Script as build.rs
participant FS as Filesystem
Cargo->>Script: Run build script
Script->>FS: Resolve CARGO_MANIFEST_DIR and OUT_DIR
Script->>FS: Copy packaging/man/<bin>.1 -> OUT_DIR/<bin>.1
Script->>Cargo: Emit cargo:rerun-if-changed=<path>
Script-->>Cargo: Exit (success or panic on error)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Comment |
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Blocking issues:
- An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `crates/comenq/build.rs:13` </location>
<code_context>
+ let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR"));
+ let source = manifest_dir.join("../../packaging/man/comenq.1");
+ let out_dir = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR"));
+ fs::create_dir_all(&out_dir)?;
+ let dest = out_dir.join("comenq.1");
+ fs::copy(&source, &dest)?;
</code_context>
<issue_to_address>
**nitpick:** Creating the output directory may be redundant as OUT_DIR should already exist.
Since Cargo ensures OUT_DIR exists, you can remove create_dir_all unless you need to create additional subdirectories.
</issue_to_address>
### Comment 2
<location> `crates/comenq/build.rs:1` </location>
<code_context>
+use std::{env, fs, path::PathBuf};
+
+fn main() {
</code_context>
<issue_to_address>
**issue (review_instructions):** Missing //! module-level comment at the top of the file.
Please add a //! comment at the top of this module to describe its purpose, as required by the review instructions.
<details>
<summary>Review instructions:</summary>
**Path patterns:** `**/*.rs`
**Instructions:**
Every module must begin with a //! comment.
</details>
</issue_to_address>
### Comment 3
<location> `crates/comenqd/build.rs:1` </location>
<code_context>
+use std::{env, fs, path::PathBuf};
+
+fn main() {
</code_context>
<issue_to_address>
**issue (review_instructions):** Missing //! module-level comment at the top of the file.
Please add a //! comment at the top of this module to describe its purpose, as required by the review instructions.
<details>
<summary>Review instructions:</summary>
**Path patterns:** `**/*.rs`
**Instructions:**
Every module must begin with a //! comment.
</details>
</issue_to_address>
### Comment 4
<location> `.github/workflows/release.yml:158` </location>
<code_context>
uses: softprops/action-gh-release@v2
</code_context>
<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
*Source: opengrep*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `test-support/src/workflow.rs:50-52` </location>
<code_context>
- use super::uses_goreleaser;
+ use super::uses_shared_release_actions;
+
+ #[test]
+ #[expect(clippy::expect_used, reason = "simplify test output")]
+ fn detects_shared_actions() {
+ let yaml = r"
+ jobs:
</code_context>
<issue_to_address>
**suggestion (testing):** Consider adding tests for malformed or incomplete YAML inputs.
Tests currently only cover valid cases and missing actions. Including cases with malformed YAML or missing keys (such as 'jobs', 'steps', or non-array steps) will help verify error handling and prevent silent failures.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary
rust-build-releaseandlinux-packagesactions, enriching the generated nfpm manifest and publishing packages viasoftprops/action-gh-releaseTesting
https://chatgpt.com/codex/tasks/task_e_68d952556b888322813fde83e70b4217
Summary by Sourcery
Adopt shared composite GitHub Actions for cross‐platform release packaging: replace the GoReleaser workflow with
rust-build-releaseandlinux-packagesactions in a build matrix, stage static man pages via build scripts, publish packages withsoftprops/action-gh-release, and update documentation and tests to reflect the new pipeline.New Features:
Enhancements:
comenqandcomenqdon x86_64 and aarch64Documentation:
Tests: