pontil_build
An esbuild bundler for GitHub Actions written in Gleam. Bundles
your Gleam action into a single CommonJS file suitable for use with GitHub
Actions.
Based on esgleam, licensed under Apache-2.0.
pontil_buildis a dev dependency. It is invoked asgleam run -m pontil_buildand configured entirely throughgleam.toml. It will warn you if you have installedpontil_buildas a regular dependency.
Usage
gleam add --dev pontil_build@1
Add bundle configuration to your gleam.toml:
[tools.pontil_build.bundle]
# All fields are optional with sensible defaults
entry = "my_action.gleam" # relative to src/, default: {name}.gleam
outdir = "dist" # default: "dist"
outfile = "index.cjs" # default: {name}.cjs
minify = true # true | false | ["whitespace", "syntax", "identifiers"]
esbuild_version = "0.28.0" # default: 0.28.0
autoinstall = true # default: true
analyze = false # false | true | "verbose"
legal_comments = "external" # "none" | "inline" | "eof" | "linked" | "external"
raw = [] # extra esbuild flags
Then bundle your action:
gleam run -m pontil_build
This produces a single .cjs file in the output directory that can be
referenced from your action.yml.
Fixed Defaults
The following esbuild options are always set and not configurable:
--bundle--format=cjs--platform=node--target=esnext- Script mode (calls
main()in your entry point)
Semantic Versioning
pontil_build follows Semantic Versioning 2.0.