Skip to content

Update cli binary workflow to push to releases#2204

Closed
findolor wants to merge 1 commit intomainfrom
cli-binary-release
Closed

Update cli binary workflow to push to releases#2204
findolor wants to merge 1 commit intomainfrom
cli-binary-release

Conversation

@findolor
Copy link
Collaborator

@findolor findolor commented Oct 14, 2025

Motivation

See issue: #2190

Solution

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • New Features

    • Each build now publishes a pre-release on GitHub Releases with a downloadable CLI binary (tar.gz) and autogenerated release notes for easier access and testing.
  • Chores

    • Streamlined the build pipeline to publish artifacts directly to a GitHub release, improving reliability and reducing manual steps.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Replaces the previous Git commit/push steps in the CLI build workflow with a GitHub Release creation using ncipollo/release-action, tagging releases with cli-${{ github.sha }}, generating release notes, and attaching the built tar.gz artifact. Removes local git config and commit/push logic.

Changes

Cohort / File(s) Summary
Workflow: Release publication via GitHub Releases
.github/workflows/build-cli-binary.yaml
Added step using ncipollo/release-action@v1 to create a prerelease with tag cli-${{ github.sha }}, name and body referencing the SHA, auto-generated release notes, and attach crates/cli/bin/rain-orderbook-cli.tar.gz as application/gzip. Removed steps: Git config and commit/push of the tarball.

Sequence Diagram(s)

sequenceDiagram
    actor Dev as Commit
    participant GH as GitHub Actions
    participant Build as Build CLI
    participant Rel as ncipollo/release-action
    participant GHRel as GitHub Releases

    Dev->>GH: Push/PR triggers workflow
    GH->>Build: Build CLI binary (tar.gz)
    Build-->>GH: Artifact: crates/cli/bin/rain-orderbook-cli.tar.gz
    GH->>Rel: Create prerelease with tag cli-${{ github.sha }}
    Rel->>GHRel: Publish release + attach artifact
    note over GH,Rel: Previous flow removed: git config, commit, and push of tarball
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • hardyjosh

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the main change of updating the GitHub Actions workflow to push the CLI binary to GitHub Releases. It refers to the correct file and the action of pushing to releases, making it clear and specific. It is neither too broad nor contains unnecessary details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cli-binary-release

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 093c274 and 024bfef.

📒 Files selected for processing (1)
  • .github/workflows/build-cli-binary.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Deploy-Docs-Preview
  • GitHub Check: Deploy-Preview-Push

Comment on lines +47 to +60
- name: Create GitHub release
id: create_release
uses: ncipollo/release-action@v1
env:
COMMIT_MESSAGE: "refresh orderbook cli"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add crates/cli/bin/rain-orderbook-cli.tar.gz
if git diff --staged --quiet; then
echo "No changes to commit"
exit 0
fi

git commit -m "$COMMIT_MESSAGE"
git push origin HEAD:${{ github.ref_name }}
with:
tag: cli-${{ github.sha }}
name: Rain Orderbook CLI ${{ github.sha }}
body: |
Rain Orderbook CLI binary built from commit ${{ github.sha }}.
prerelease: true
generateReleaseNotes: true
artifacts: crates/cli/bin/rain-orderbook-cli.tar.gz
artifactContentType: application/gzip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Allow updates so reruns don’t hard‑fail.

ncipollo/release-action defaults allowUpdates to false, so a rerun (same commit/tag) will error: “A release with tag cli-${{ github.sha }} already exists.” Set allowUpdates: true (and typically removeArtifacts: true) to make the workflow resumable.

Apply this diff:

       with:
         tag: cli-${{ github.sha }}
         name: Rain Orderbook CLI ${{ github.sha }}
         body: |
           Rain Orderbook CLI binary built from commit ${{ github.sha }}.
         prerelease: true
         generateReleaseNotes: true
         artifacts: crates/cli/bin/rain-orderbook-cli.tar.gz
         artifactContentType: application/gzip
+        allowUpdates: true
+        removeArtifacts: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Create GitHub release
id: create_release
uses: ncipollo/release-action@v1
env:
COMMIT_MESSAGE: "refresh orderbook cli"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git add crates/cli/bin/rain-orderbook-cli.tar.gz
if git diff --staged --quiet; then
echo "No changes to commit"
exit 0
fi
git commit -m "$COMMIT_MESSAGE"
git push origin HEAD:${{ github.ref_name }}
with:
tag: cli-${{ github.sha }}
name: Rain Orderbook CLI ${{ github.sha }}
body: |
Rain Orderbook CLI binary built from commit ${{ github.sha }}.
prerelease: true
generateReleaseNotes: true
artifacts: crates/cli/bin/rain-orderbook-cli.tar.gz
artifactContentType: application/gzip
- name: Create GitHub release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: cli-${{ github.sha }}
name: Rain Orderbook CLI ${{ github.sha }}
body: |
Rain Orderbook CLI binary built from commit ${{ github.sha }}.
prerelease: true
generateReleaseNotes: true
artifacts: crates/cli/bin/rain-orderbook-cli.tar.gz
artifactContentType: application/gzip
allowUpdates: true
removeArtifacts: true
🤖 Prompt for AI Agents
.github/workflows/build-cli-binary.yaml around lines 47 to 60: the release
action will fail on reruns because ncipollo/release-action defaults allowUpdates
to false; update the action inputs to set allowUpdates: true (and also set
removeArtifacts: true) so the workflow can resume on the same tag/artifacts
without hard-failing when a release already exists.

@findolor findolor requested review from 0xgleb and hardyjosh October 14, 2025 09:15
@findolor findolor closed this Nov 17, 2025
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.

Update binary creation worklfow to push the binary into releases instead of commiting

1 participant