Skip to content

ci: add publish workflow - #2

Merged
Danite merged 4 commits into
mainfrom
ci/add_publish_workflow
Apr 6, 2026
Merged

Danite merged 4 commits into
mainfrom
ci/add_publish_workflow

Conversation

@Danite

@Danite Danite commented Apr 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

@Danite

Danite commented Apr 6, 2026

Copy link
Copy Markdown
Owner Author

@greptile review

@greptile-apps

greptile-apps Bot commented Apr 6, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR adds a GitHub Actions release workflow that automatically publishes looper-cli to crates.io when a GitHub Release is created, along with the necessary Cargo.toml metadata for crates.io and updated README install instructions. Test snapshot files for JSON and SARIF output formats are also included.

  • New .github/workflows/release.yml validates the tag is in vX.Y.Z format, patches the Cargo.toml version in-place with sed, runs the test suite, then publishes with cargo publish --allow-dirty
  • Cargo.toml gains all required crates.io metadata: description, license, repository, keywords, categories, exclude, and MSRV (rust-version = "1.92.0")
  • README.md is updated with the cargo install looper-cli install command and a CI usage example
  • Integration test snapshots for JSON and SARIF output formats are added

Confidence Score: 4/5

Safe to merge; the workflow is well-structured with tag validation, test gating, and least-privilege permissions.

Previous review concerns (missing permissions block, sed fragility) are now addressed. One non-blocking best-practice improvement remains: adding --locked to cargo test to ensure the published crate is tested against the exact checked-in dependency tree.

.github/workflows/release.yml — worth a final look for the --locked suggestion before merge.

Important Files Changed

Filename Overview
.github/workflows/release.yml New publish workflow: validates tag format, patches Cargo.toml version, runs tests, publishes to crates.io; --locked omitted from cargo test
Cargo.toml Added complete crates.io metadata (description, license, MSRV, repository, keywords, categories, exclude)
README.md Added install instructions and CI usage example
tests/json_output_test.rs Integration tests for JSON output format including schema validation, round-trip, and snapshot tests
tests/sarif_output_test.rs Integration tests for SARIF output format covering version, tool info, rules, locations, and confidence mapping
tests/snapshots/json_output_test__json_manifest.snap insta snapshot for JSON manifest output with redacted timestamp and version
tests/snapshots/sarif_output_test__sarif_output.snap insta snapshot for SARIF output with redacted driver version
Cargo.lock Lockfile updated to reflect new Cargo.toml metadata fields

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Release
    participant WF as Workflow Runner
    participant CT as Cargo.toml
    participant Tests as cargo test
    participant CratesIO as crates.io

    GH->>WF: release published (vX.Y.Z tag)
    WF->>WF: Extract version from GITHUB_REF_NAME
    WF->>WF: Validate format (^[0-9]+\\.[0-9]+\\.[0-9]+$)
    WF->>CT: sed patch: version = "X.Y.Z"
    WF->>Tests: cargo test
    Tests-->>WF: pass / fail
    WF->>CratesIO: cargo publish --allow-dirty
    CratesIO-->>WF: published looper-cli@X.Y.Z
Loading

Reviews (2): Last reviewed commit: "clean up" | Re-trigger Greptile

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
@Danite
Danite merged commit 766b84e into main Apr 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant