Skip to content

C-Proj

Latest

Choose a tag to compare

@mmycin mmycin released this 25 Feb 12:56
· 6 commits to main since this release

To create a release for your Rust CLI project, follow these steps:


🚀 Creating a Release for Your Rust CLI Project

We’ll build, package, and publish a release on GitHub.

1️⃣ Build the Release Binaries

Run the following to create optimized binaries for different platforms:

cargo build --release

This will generate a binary at:

target/release/c-template-installer

For cross-platform support, build for different targets:

cargo build --release --target x86_64-unknown-linux-gnu  # Linux
cargo build --release --target x86_64-apple-darwin      # macOS
cargo build --release --target x86_64-pc-windows-gnu    # Windows

The compiled binaries will be in:

target/x86_64-unknown-linux-gnu/release/c-template-installer
target/x86_64-apple-darwin/release/c-template-installer
target/x86_64-pc-windows-gnu/release/c-template-installer.exe

2️⃣ Create a Release Archive

Package each binary with a README and LICENSE:

mkdir -p release

tar -czvf release/c-template-linux.tar.gz -C target/x86_64-unknown-linux-gnu/release c-template-installer
tar -czvf release/c-template-mac.tar.gz -C target/x86_64-apple-darwin/release c-template-installer
zip -j release/c-template-windows.zip target/x86_64-pc-windows-gnu/release/c-template-installer.exe

3️⃣ Create a New GitHub Release

  1. Go to your GitHub repository: https://github.com/mmycin/C-Template-Installer
  2. Click on Releases → Draft a new release
  3. Set a version tag, e.g., v1.0.0
  4. Add release notes (copy from your README)
  5. Upload the archives:
    • release/c-template-linux.tar.gz
    • release/c-template-mac.tar.gz
    • release/c-template-windows.zip
  6. Click Publish Release 🎉

4️⃣ Install the CLI (for Users)

After publishing, users can install your CLI like this:

curl -L -o c-template.tar.gz https://github.com/mmycin/C-Template-Installer/releases/latest/download/c-template-linux.tar.gz
tar -xzvf c-template.tar.gz
chmod +x c-template-installer
sudo mv c-template-installer /usr/local/bin/c-template

Now they can use:

c-template my-project

🔥 Your Release is Live!

Congratulations, your Rust CLI is officially released! 🚀