Add Linux AppImage build entrypoint and npm script#318297
Conversation
Ship build-appimage.sh, package-appimage.sh, and .nvmrc-aware ensure-nvm-node so a single command can produce a deployable AppImage; document it in BUILD.md. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a Linux AppImage packaging workflow to build a single-file Code - OSS artifact from an existing desktop build output.
Changes:
- Introduces
scripts/package-appimage.shto stage an AppDir and runappimagetoolto produce an AppImage - Adds
scripts/ensure-nvm-node.shto prefer the.nvmrcNode version for packaging scripts - Wires up
npm run package-linux-appimage, plus a small wrapper script and brief BUILD docs
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/package-appimage.sh | New AppImage packaging script (staging, desktop/AppRun setup, tool download, build output) |
| scripts/ensure-nvm-node.sh | New helper to source NVM and put the .nvmrc Node version first on PATH |
| package.json | Adds an npm script entry to run the AppImage packaging script |
| build-appimage.sh | Adds a repo-root wrapper to run the npm packaging script |
| BUILD.md | Documents how to invoke the AppImage build |
| URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${TOOL_ARCH}.AppImage" | ||
| echo "==> Downloading appimagetool (${TOOL_ARCH})…" | ||
| if command -v curl >/dev/null 2>&1; then | ||
| curl -fsSL -o "$CACHED.tmp" "$URL" && mv "$CACHED.tmp" "$CACHED" | ||
| else | ||
| wget -q -O "$CACHED.tmp" "$URL" && mv "$CACHED.tmp" "$CACHED" | ||
| fi |
| sed -i "s|^Exec=/usr/share/${APP_NAME}/${APP_NAME} --new-window|Exec=AppRun --new-window|" "$DESKTOP" | ||
| sed -i "s|^Exec=/usr/share/${APP_NAME}/${APP_NAME} %F|Exec=AppRun %F|" "$DESKTOP" |
|
|
||
| echo "==> Staging AppDir from $BINARY_PARENT …" | ||
| cp -a "$BINARY_PARENT"/. "$APPDIR/usr/share/${APP_NAME}/" | ||
| chmod +x "$APPDIR/usr/share/${APP_NAME}/${APP_NAME}" || true |
| APPIMAGETOOL="${APPIMAGETOOL:-}" | ||
| if [[ -z "$APPIMAGETOOL" || ! -f "$APPIMAGETOOL" ]]; then | ||
| CACHED="$ROOT/.build/tools/appimagetool-${TOOL_ARCH}.AppImage" | ||
| if [[ ! -f "$CACHED" ]]; then |
| export ARCH="$AI_ARCH" | ||
| # Avoid requiring FUSE on the build host when appimagetool itself is an AppImage | ||
| export APPIMAGE_EXTRACT_AND_RUN=1 | ||
| "$APPIMAGETOOL" --verbose "$APPDIR" "$OUTFILE" |
| nvm install "$NODE_VER" >/dev/null 2>&1 || true | ||
| nvm use "$NODE_VER" |
|
@ritz123 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Ship build-appimage.sh, package-appimage.sh, and .nvmrc-aware ensure-nvm-node so a single command can produce a deployable AppImage; document it in BUILD.md.