Chore(ci)
This commit is contained in:
@@ -9,8 +9,9 @@ all of its input from standard input.
|
||||
## Standalone executable
|
||||
|
||||
Gleam can package the Erlang version of the program as an escript. An escript
|
||||
is one executable file containing the compiled program and its dependencies
|
||||
(it does require Erlang to be installed on the machine where it is run).
|
||||
is one executable file containing the compiled program and its dependencies.
|
||||
The target system must still have a compatible Erlang/OTP installation with
|
||||
`escript` on `PATH`.
|
||||
|
||||
From the project directory, run:
|
||||
|
||||
@@ -50,6 +51,67 @@ printf '%s\n' '!4 emphasized text' | ./luma_markdown
|
||||
With no arguments, the executable reads until standard input reaches EOF and
|
||||
writes the resulting Markdown to standard output.
|
||||
|
||||
### ARM builds
|
||||
|
||||
The escript contains portable BEAM bytecode, so the same file can work on
|
||||
x86, ARM64, and ARM32. It is not, however, a self-contained native executable:
|
||||
the target still needs Erlang/OTP. If the ARM system cannot have anything
|
||||
installed, this built-in export is not sufficient.
|
||||
|
||||
```sh
|
||||
gleam export escript
|
||||
./luma_markdown input.luma
|
||||
```
|
||||
|
||||
For a no-install distribution, produce one bundled native artifact per
|
||||
architecture (for example, an x86_64 Linux artifact and an ARM64 Linux
|
||||
artifact). A native executable cannot run on both instruction sets. This
|
||||
repository uses [Queso](https://github.com/jtdowney/queso) to bundle the
|
||||
Erlang runtime and cross-compile the native launcher.
|
||||
|
||||
Install Queso and Zig once on the build machine:
|
||||
|
||||
```sh
|
||||
cargo install --locked queso
|
||||
cargo install cargo-zigbuild
|
||||
# Install Zig from https://ziglang.org/download/
|
||||
# Install Rust through https://rustup.rs (the build script adds the targets)
|
||||
```
|
||||
|
||||
On Arch Linux, the Rust toolchain manager can be installed with:
|
||||
|
||||
```sh
|
||||
sudo pacman -S rustup
|
||||
rustup default stable
|
||||
```
|
||||
|
||||
Then build both self-contained binaries with one command:
|
||||
|
||||
```sh
|
||||
./scripts/build-linux-binaries.sh
|
||||
```
|
||||
|
||||
The results are:
|
||||
|
||||
```text
|
||||
./luma_markdown-linux-x86_64
|
||||
./luma_markdown-linux-arm64
|
||||
```
|
||||
|
||||
Copy the matching file to a Linux system and run it directly. The destination
|
||||
does not need Erlang, Gleam, Zig, or Queso.
|
||||
|
||||
### CI artifacts
|
||||
|
||||
Every push runs the native build in Gitea Actions after formatting succeeds.
|
||||
The workflow uploads two downloadable artifacts:
|
||||
|
||||
- `luma_markdown-linux-x86_64`
|
||||
- `luma_markdown-linux-arm64`
|
||||
|
||||
Download the artifact matching the destination machine, make it executable if
|
||||
necessary, and run it directly.
|
||||
|
||||
## Neovim preview
|
||||
|
||||
The working preview configuration is also included in
|
||||
|
||||
Reference in New Issue
Block a user