GithubHelp home page GithubHelp logo

playform / cargo-packager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crabnebula-dev/cargo-packager

1.0 1.0 0.0 1.25 MB

Rust executable packager, bundler and updater.

License: Apache License 2.0

Shell 0.52% Rust 77.01% AppleScript 0.61% NSIS 21.86%

cargo-packager's Introduction

cargo-packager

cargo-packager splash

Rust executable packager, bundler and updater. A tool and library to generate installers or app bundles for your executables. It also has a comptabile updater through cargo-packager-updater.

CLI

Installation

cargo install cargo-packager --locked

Usage

  1. Add Packager.toml or packager.json in your project or modify Cargo.toml and include

    [package.metadata.packager]
    before-packaging-command = "cargo build --release"
  2. Run the CLI

    cargo packager --release

Supported packages

  • macOS
    • DMG (.dmg)
    • Bundle (.app)
  • Linux
    • Debian package (.deb)
    • AppImage (.AppImage)
  • Windows
    • NSIS (.exe)
    • MSI using WiX Toolset (.msi)

Configuration

By default, cargo-packager reads a configuration from Packager.toml or packager.json if it exists, and from package.metadata.packager table in Cargo.toml. You can also specify a custom configuration file using the -c/--config cli argument. All configuration options could be either a single config or array of configs.

For a full list of configuration options, see https://docs.rs/cargo-packager/latest/cargo_packager/config/struct.Config.html

You could also use the schema from GitHub releases to validate your configuration or have auto completions turned on in your IDE.

Building your application before packaging

By default, cargo-packager doesn't build your application, it only looks for it inside the directory specified in config.out_dir or --out-dir cli arg, However, cargo-packager has an option to specify a shell command to be executed before packaing your app, beforePackagingCommand.

Cargo profiles

By default, cargo-packager looks for binaries built using the debug profile, if your beforePackagingCommand builds your app using cargo build --release, you will also need to run cargo-packager in release mode cargo packager --release, otherwise, if you have a custom cargo profile, you will need to specify it using --profile cli arg cargo packager --profile custom-release-profile.

For more information, checkout the available configuration options and for a list of available CLI commands and arguments, run cargo packager --help.

Examples

The examples directory contains a number of varying examples, if you want to build them all run cargo r -p cargo-packager -- --release in the root of this repository. Just make sure to have the tooling for each example installed on your system. You can find what tooling they require by checking the README in each example. The README also contains a command to build this example alone if you wish.

Examples list (non-exhaustive):

Library

This crate is also published to crates.io as a library that you can integrate into your tooling, just make sure to disable the default-feature flags.

cargo add cargo-packager --no-default-features

Feature flags

  • cli: Enables the CLI specifc features and dependencies. Enabled by default.
  • tracing: Enables tracing crate integration.

Licenses

MIT or MIT/Apache 2.0 where applicable.

cargo-packager's People

Contributors

amr-crabnebula avatar renovate[bot] avatar jason-crabnebula avatar crabnejonas avatar lucasfernog-crabnebula avatar github-actions[bot] avatar bmann avatar felsweg-crabnebula avatar

Stargazers

Nikola Hristov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.