Skip to content

feat(granola): add cargo-dist for per-platform binary builds and npm package - #2355

Closed
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1765950359-export-granola-cli
Closed

devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1765950359-export-granola-cli

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Dec 17, 2025 •

Copy link
Copy Markdown
Contributor

feat(granola): add cargo-dist for per-platform binary builds and npm package

Summary

Replaces the manual npm package infrastructure with cargo-dist, which provides automated per-platform binary builds and multiple installation methods including npm/npx access.

Files added:

  • dist-workspace.toml - cargo-dist configuration with npm, shell, and powershell installers
  • .github/workflows/release.yml - Auto-generated GitHub Actions workflow for releases
  • apps/granola/README.md - Documentation with multiple installation methods

Files removed (replaced by cargo-dist):

  • apps/granola/package.json
  • apps/granola/bin/export-granola.js
  • apps/granola/scripts/postinstall.js

Cargo.toml updates:

  • Added [profile.dist] for optimized release builds with LTO
  • Added [package.metadata.dist] to granola-cli with dist = true and npm-package = "export-granola"
  • Workspace-level dist = false ensures only granola-cli is distributed (monorepo setup)

Installation methods provided:

  • npx export-granola - npm/npx access
  • Shell script installer (macOS/Linux)
  • PowerShell installer (Windows)

Supported platforms: macOS (x64/arm64), Linux (x64/arm64), Windows (x64)

Updates since last revision

  • Replaced manual npm package with cargo-dist: Instead of custom postinstall scripts, cargo-dist now handles binary distribution automatically
  • Added GitHub Actions workflow: The release.yml workflow builds binaries for all platforms and creates GitHub releases when version tags are pushed
  • Monorepo configuration: Set dist = false at workspace level so only granola-cli is distributed, not other workspace binaries
  • Added allow-dirty = ["ci"]: Workaround for dprint/cargo-dist formatting conflict (dprint uses double quotes in YAML, cargo-dist generates single quotes). This tells cargo-dist to skip validation of the CI file contents.

Review & Testing Checklist for Human

  • First release test (critical): The entire workflow is untested. Push a test tag like granola-cli/0.1.0 or v0.1.0 to verify binaries build correctly for all platforms
  • NPM_TOKEN secret: The npm installer requires an NPM_TOKEN secret to be configured in GitHub Actions for publishing to npm. Verify this exists or create it.
  • Release workflow trigger: The workflow triggers on tags matching **[0-9]+.[0-9]+.[0-9]+*. Verify this won't conflict with existing release workflows (e.g., desktop_cd.yaml uses desktop_v* tags)
  • npm package name: Verify npm-package = "export-granola" correctly sets the npm package name after a real release
  • Test npx export-granola --help after the first release is published to npm

Recommended test plan:

  1. Review the generated release.yml workflow
  2. Ensure NPM_TOKEN secret is configured
  3. Push a test tag like granola-cli/0.1.0 to trigger the release workflow
  4. Monitor the GitHub Actions run for all platform builds
  5. After release, test npx export-granola --help

Notes

  • cargo-dist version: 0.30.3
  • The workflow runs dist plan on PRs to validate configuration without building (now passing after allow-dirty fix)
  • Windows arm64 is not currently supported
  • The allow-dirty = ["ci"] setting means cargo-dist won't error if the release.yml drifts from its expected format

Link to Devin run: https://app.devin.ai/sessions/df74732fbe2642a39d87592d30473dc3
Previous Devin run: https://app.devin.ai/sessions/7aef1b61107c43ce91d59688afdeb56e
Requested by: yujonglee (@yujonglee)

- Add package.json with name 'export-granola' and bin entry
- Add bin/export-granola.js wrapper script to execute platform binary
- Add scripts/postinstall.js to download pre-built binaries
- Add README.md with usage documentation
- Update Cargo.toml with package metadata

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@netlify

netlify Bot commented Dec 17, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit f40dd69
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69424e58e0b320000816880d
😎 Deploy Preview https://deploy-preview-2355--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

@netlify

netlify Bot commented Dec 17, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit f40dd69
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/69424e5849cce200082ea0e8
😎 Deploy Preview https://deploy-preview-2355--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

devin-ai-integration Bot and others added 2 commits December 17, 2025 05:57
…lable

- Exit with code 0 on 404 (binary not yet published)
- Exit with code 0 on other download errors to not break CI
- Improve error messages for developers

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
- Add cargo-dist configuration (dist-workspace.toml) with npm, shell, and powershell installers
- Configure granola-cli as the only distributable package (dist = false at workspace level)
- Add GitHub Actions workflow (release.yml) for automated releases on version tags
- Set npm package name to 'export-granola' for npx access
- Remove manual npm package files (bin/, scripts/, package.json) in favor of cargo-dist generated package
- Update README.md with additional installation methods (shell script, PowerShell)

The release workflow will:
- Build binaries for macOS (x64/arm64), Linux (x64/arm64), and Windows (x64)
- Generate npm package for 'npx export-granola' access
- Generate shell/powershell installer scripts
- Create GitHub releases with all artifacts

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

3 similar comments
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it.

@devin-ai-integration devin-ai-integration Bot changed the title feat(granola): expose CLI as npm package for npx export-granola feat(granola): add cargo-dist for per-platform binary builds and npm package Dec 17, 2025
…erences

cargo-dist expects single quotes in the release.yml tag pattern, but dprint
formats it with double quotes. Adding allow-dirty = ["ci"] tells cargo-dist
to ignore this formatting difference.

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@yujonglee yujonglee closed this Dec 17, 2025
@yujonglee
yujonglee deleted the devin/1765950359-export-granola-cli branch December 17, 2025 10:02
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