CLI utility that packs a binary executable into a redistributable archive.
outs/1/compiled.kexe ⮕ myapp_linux_arm64.tgz with myapp inside
outs/2/compiled.kexe ⮕ myapp_windows_amd64.zip with myapp.exe inside
outs/3/compiled.kexe ⮕ myapp_macos_arm64.tgz with myapp inside
- It detects the architecture for which the executable is compiled
- It sets executable bits for *nix binaries (
chmod 755) - It adds
.exeextension to Windows executables - It packs the binary to an archive appropriate for the platform
Let's imagine that our automated system compiles executables using Kotlin
Native. Regardless of the platform, the script builds a compiled.kexe.
Before the release, we can collect all the built files in one directory.
outs/1/compiled.kexeouts/2/compiled.kexeouts/3/compiled.kexe
But how to distinguish and name them? exe2dist automatically solves this
problem.
exe2dist myapp outs/*/*.kexe targetdirThis command will create three archives with friendly names.
exe2dist runs on Linux and macOS. It may process binaries that target other
platforms.
Download and extract a binary executable release:
Download and unpack the Linux version to the current directory.
wget -c https://github.com/rtmigo/exe2dist/releases/download/0.3.3/exe2dist_linux_amd64.tgz -O - | tar -xzRun immediately:
./exe2distSame for the newest version instead of the fixed one.
wget -c https://github.com/rtmigo/exe2dist/releases/latest/download/exe2dist_linux_amd64.tgz -O - | tar -xzArchive file ./native_exe to a distributable
like distros/theapp_macos_arm64.tgz:
exe2dist theapp native_exe distros/Archive all files in ./binaries creating appropriate distributable files in
distros:
exe2dist theapp binaries/* distros/The safe systems are Linux, macOS (Darwin) and Windows.
The safe platforms are x86-64 (AMD64) and ARM64.
If you are building executables for *BSD or more rare *nix systems, this utility should be used with caution. It will rely on guesswork, and may wrongly assume, that the executable is for Linux.
Copyright © 2022 Artsiom iG. Released under the MIT License.