Skip to content

feat: Add single-file Windows executable using Deno#1018

Open
benriemer wants to merge 1 commit intomermaid-js:masterfrom
benriemer:feat/single-file-windows-exe
Open

feat: Add single-file Windows executable using Deno#1018
benriemer wants to merge 1 commit intomermaid-js:masterfrom
benriemer:feat/single-file-windows-exe

Conversation

@benriemer
Copy link
Copy Markdown

Summary

This PR adds a GitHub Actions workflow to build a single-file Windows executable (.exe) for mermaid-cli using Deno's compile feature.

Problem

Issue #467 requests a single-file Windows executable so non-developers can use mermaid-cli without installing Node.js/npm. The original solution (pkg) was deprecated and never supported ESM modules.

Solution

Use Deno to build the executable:

  • Deno natively supports ESM (the module format used by mermaid-cli)
  • deno compile packages all dependencies into a single executable
  • Cross-compile from Windows GitHub Actions runner to x86_64-pc-windows-msvc

Changes

  1. New workflow: .github/workflows/build-single-file.yml

    • Runs on: push to master, new tags, and manual trigger
    • Uses denoland/setup-deno action
    • Builds with: deno compile --target x86_64-pc-windows-msvc
    • Uploads as release asset on tagged releases
  2. Documentation: Updated README.md with standalone executable usage

Testing

The workflow can be tested manually or by creating a tag:

  • Manual: Use workflow_dispatch trigger
  • Release: Create a new release to build and upload .exe

Related Issues

Closes #467

- Add GitHub Actions workflow to build mmdc.exe using deno compile
- Cross-compile from Windows runner to x86_64-pc-windows-msvc target
- Upload executable as release asset on tagged releases
- Add documentation for standalone Windows executable usage

Closes mermaid-js#467
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Making a single-file mermaid-cli.exe for Windows

1 participant