You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Packaging a Node.js app with pkg inside a GitHub Actions workflow today means hand-rolling the same pipeline over and over: install @yao-pkg/pkg, run it, locate the outputs, rename them, compress them, generate checksums, upload as artifacts or attach to a release. Every consumer reinvents this boilerplate and the results diverge (naming schemes, compression formats, checksum algorithms, cross-compile caveats, etc.).
Proposal
Ship a first-party yao-pkg/pkg-action repository that wraps the common pipeline. A minimal consumer should look like:
Prefer a composite action so setup-node + cache actions compose naturally; drop to a small JavaScript action only for pieces that need real logic (templating, checksums, archive creation, signing orchestration).
Keep the action repo separate from yao-pkg/pkg so it can version and release on its own cadence, but document the supported pkg major range.
Publish to the GitHub Marketplace once v1 stabilizes.
Packaging a Node.js app with
pkginside a GitHub Actions workflow today means hand-rolling the same pipeline over and over: install@yao-pkg/pkg, run it, locate the outputs, rename them, compress them, generate checksums, upload as artifacts or attach to a release. Every consumer reinvents this boilerplate and the results diverge (naming schemes, compression formats, checksum algorithms, cross-compile caveats, etc.).Proposal
Ship a first-party
yao-pkg/pkg-actionrepository that wraps the common pipeline. A minimal consumer should look like:Inputs (initial scope)
Build configuration
config— path to pkg config (package.json,.pkgrconce feat: support a .pkgrc configuration file #238 lands, custom JSON/JS). Auto-detect by default.entry— entry script if not specified in config.targets— comma/newline-separated list. Defaults to host target.mode—standardorsea.node-version— override the bundled Node.js major (e.g.22,24).compress-node— pass-through for pkg's--compress(Brotli/GZip/None).fallback-to-source— pass-through for the bytecode fallback flag (feat: add --fallback-to-source flag for bytecode failures #246).public— expose source (--public).extra-args— escape hatch for raw pkg CLI flags.Post-build
compress— archive format:tar.gz | tar.xz | zip | 7z | none, one archive per target.filename— output filename template. Tokens:{name},{version},{target},{node},{os},{arch},{sha}(short commit),{ref},{date},{tag}.checksum—sha256 | sha512 | md5 | none(or comma list). Emits sidecar*.sha256files and a combinedSHASUMS256.txt.strip— strip debug symbols on Linux/macOS.Signing & notarization
macos-sign-identity/macos-keychain-password— codesign wrapper.macos-notarize+ Apple ID / team ID / app-specific password —notarytoolwrapper.windows-sign-cert/windows-sign-password— signtool wrapper.Publishing
upload-artifact— upload each produced file as a workflow artifact (defaulttrue).artifact-name— artifact name template (defaults tofilename).attach-to-release— if the triggering ref is a tag, attach to the matching GitHub Release.release-tag— override the target release tag.draft-release/prerelease— pass-through togh release.Performance
cache— cachepkg-fetchNode.js downloads (defaulttrue).cache-key— override the cache key.Outputs
binaries— JSON array of produced binary paths (pre-compression).artifacts— JSON array of final uploaded file paths (post-compression).checksums— path to the combinedSHASUMS*.txt.version— resolved package version used in templating.Stretch goals
targetsinto a job matrix so each platform runs on its native runner, dodging the cross-compile pitfalls tracked in NodeJS 22/24 issues/feedbacks tracker #87 / Cross-compilation from macOS to Linux on arm64 broken on >=22 #181.actions/attest-build-provenance.Implementation notes
setup-node+ cache actions compose naturally; drop to a small JavaScript action only for pieces that need real logic (templating, checksums, archive creation, signing orchestration).yao-pkg/pkgso it can version and release on its own cadence, but document the supported pkg major range.examples/with: single-binary release, multi-OS matrix, SEA mode, signed macOS bundle, attach-to-release.Part of #235