From 7e290862de195499eab0581aa5d6f59c427d0eaf Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Tue, 17 Nov 2026 12:14:58 +0200 Subject: [PATCH 1/4] Build deb and rpm packages for Linux alongside the AppImage Adds the deb and rpm targets back so #782 can run #388's bundled-Git checks from a real package install. The Linux Buildkite job installs rpmbuild and uploads both packages. The packages and the program they install are named wordpress-contributor-toolkit instead of the npm package name, and desktopName is set so the desktop entry's StartupWMClass is stated rather than derived. Co-Authored-By: Claude Opus 5.5 --- .buildkite/pipeline.yml | 8 +++++++- README.md | 2 +- package.json | 13 ++++++++++++- src/main.js | 6 +++--- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 8561e0c8..62217b56 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -72,7 +72,11 @@ steps: echo "~~~ Install Node dependencies" npm ci --no-audit --no-progress --maxsockets 1 - echo "~~~ Build Linux artifact" + echo "~~~ Install rpmbuild for the rpm target" + apt-get update -qq + apt-get install -y -qq --no-install-recommends rpm + + echo "~~~ Build Linux artifacts" npm run dist plugins: - $DOCKER_PLUGIN: @@ -80,6 +84,8 @@ steps: always-pull: true artifact_paths: - dist/*.AppImage + - dist/*.deb + - dist/*.rpm notify: - github_commit_status: { context: "Linux Build" } diff --git a/README.md b/README.md index acab06e1..564ea2bd 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ npm run dist:win:arm64 The renderer is bundled by esbuild into `src/renderer/index.js` and `index.css`. Those are generated files, are not committed, and are rebuilt by `npm install`, `npm start` and every `npm run dist` — so there is no bundling step to remember after changing `src/renderer/index.jsx` or the components and hooks it imports from `src/renderer/components/` and `src/renderer/hooks/`. `npm run build:once` still exists if you want to rebuild on its own. -Output goes to `dist/`. On Linux, `npm run dist` creates an AppImage. macOS packages use the build machine's architecture, and the published macOS builds currently target Apple Silicon (`arm64`) only. +Output goes to `dist/`. On Linux, `npm run dist` creates an AppImage, a `.deb` and an `.rpm`; building the `.rpm` needs `rpmbuild` (the `rpm` package on Debian and Ubuntu). The deb and rpm packages are not published yet, until [#782](https://github.com/WordPress/contributor-toolkit/issues/782) has tested the bundled Git inside them. macOS packages use the build machine's architecture, and the published macOS builds currently target Apple Silicon (`arm64`) only. ### App icon diff --git a/package.json b/package.json index 2cbeaf8e..9712d96e 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "license": "GPL-2.0-or-later", "description": "Desktop app that sets up a WordPress core development environment with no prerequisites, applies the work already on a Trac ticket, and submits a contribution back", "homepage": "https://wordpress.github.io/contributor-toolkit/", + "desktopName": "WordPress Contributor Toolkit", "repository": { "type": "git", "url": "git+https://github.com/WordPress/contributor-toolkit.git" @@ -99,10 +100,20 @@ "icon": "build/icon.png", "linux": { "maintainer": "WordPress.org", + "category": "Development", + "executableName": "wordpress-contributor-toolkit", "target": [ - "AppImage" + "AppImage", + "deb", + "rpm" ] }, + "deb": { + "packageName": "wordpress-contributor-toolkit" + }, + "rpm": { + "packageName": "wordpress-contributor-toolkit" + }, "win": { "icon": "build/icon.ico", "signtoolOptions": { diff --git a/src/main.js b/src/main.js index a786af61..8bf29cd4 100644 --- a/src/main.js +++ b/src/main.js @@ -845,9 +845,9 @@ function relaunchArgs(argv) { return argv.slice(1).filter((arg) => !pickDeepLinkArg([arg]) && !arg.startsWith('--lang=')); } -// On Linux the app is an AppImage, mounted while it runs at the path the -// process was started from and gone once it quits: the new instance is -// started from the image itself. +// An AppImage is mounted while it runs at the path the process was started +// from and gone once it quits, so the new instance is started from the image +// itself. A deb or rpm install has no APPIMAGE and relaunches in place. ipcMain.handle('app:relaunch', () => { app.relaunch({ args: relaunchArgs(process.argv), From cbcc3063bca3757de8a094f88b4f764dfd4a3034 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Tue, 17 Nov 2026 12:24:32 +0200 Subject: [PATCH 2/4] Name the running app after the .desktop file the packages install Electron uses desktopName as the Wayland app_id, the X11 WM_CLASS and the name it gives xdg-settings when registering the wpct:// handler, so it has to match the installed wordpress-contributor-toolkit.desktop. A unit test keeps desktopName and build.linux.executableName in step. RELEASING.md says to leave the deb and rpm out of a release until #782 is done. Co-Authored-By: Claude Opus 5.5 --- RELEASING.md | 2 +- package.json | 2 +- tests/unit/linux-desktop-name.test.cjs | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/unit/linux-desktop-name.test.cjs diff --git a/RELEASING.md b/RELEASING.md index 17c21e8f..9175ea7e 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -38,7 +38,7 @@ Versions are `X.Y.Z` for a stable release and `X.Y.Z-beta.N` for a beta. Tags ad Buildkite builds signed Windows, macOS and Linux artifacts for the pull request's branch. Before merging, open the build for the pull request's **current head commit** (`gh pr view --json headRefOid --jq .headRefOid`), download the three files into one directory, and check them. Buildkite reports nothing back to the pull request (`.buildkite/pipeline.yml` asks for a commit status per platform, but none reached the 2.0.0 bump pull request), so the commit can only be read on the build's page in Buildkite: compare it with `headRefOid` there, by eye. -- The files are named `wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, `wordpress-contributor-toolkit-X.Y.Z-mac-arm64.dmg` and `wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.AppImage`. The Windows file may download as `dist_wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, because the Windows build uploads it from `dist\`. Rename it to remove the `dist_` prefix, so its name matches the other two. +- The files are named `wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, `wordpress-contributor-toolkit-X.Y.Z-mac-arm64.dmg` and `wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.AppImage`. The Windows file may download as `dist_wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, because the Windows build uploads it from `dist\`. Rename it to remove the `dist_` prefix, so its name matches the other two. The Linux build also lists a `.deb` and an `.rpm`; leave them out of the release until [#782](https://github.com/WordPress/contributor-toolkit/issues/782) has tested the bundled Git inside them. - The macOS app is signed with Automattic's Developer ID, notarized, and has its ticket stapled. - The Windows installer carries an Authenticode signature from Automattic Inc. - The app's `app.asar` root holds exactly `node_modules`, `package.json` and `src`, with npm 11 under `node_modules/npm` and no `.codesigning` directory. diff --git a/package.json b/package.json index 9712d96e..64511581 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "license": "GPL-2.0-or-later", "description": "Desktop app that sets up a WordPress core development environment with no prerequisites, applies the work already on a Trac ticket, and submits a contribution back", "homepage": "https://wordpress.github.io/contributor-toolkit/", - "desktopName": "WordPress Contributor Toolkit", + "desktopName": "wordpress-contributor-toolkit.desktop", "repository": { "type": "git", "url": "git+https://github.com/WordPress/contributor-toolkit.git" diff --git a/tests/unit/linux-desktop-name.test.cjs b/tests/unit/linux-desktop-name.test.cjs new file mode 100644 index 00000000..9cf3f473 --- /dev/null +++ b/tests/unit/linux-desktop-name.test.cjs @@ -0,0 +1,16 @@ +// Guards the Linux desktop identity of the packaged app. +// +// Electron names the running app after desktopName in package.json: it is the Wayland app_id, the +// X11 WM_CLASS and what setAsDefaultProtocolClient('wpct') hands to xdg-settings. electron-builder +// names the installed .desktop file after build.linux.executableName. The two have to agree, or the +// desktop cannot tie the open window to its menu entry and the wpct:// registration names a file +// that does not exist (#782). + +const test = require('node:test'); +const assert = require('node:assert/strict'); + +const pkg = require('../../package.json'); + +test('desktopName names the .desktop file the Linux packages install', () => { + assert.equal(pkg.desktopName, `${pkg.build.linux.executableName}.desktop`); +}); From e435f087c3cd6c89df7ace8a4b848bb1fb4cdbd4 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Tue, 17 Nov 2026 12:31:20 +0200 Subject: [PATCH 3/4] Remove the #782 notes from the README and RELEASING.md Co-Authored-By: Claude Opus 5.5 --- README.md | 2 +- RELEASING.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 564ea2bd..3df8f287 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ npm run dist:win:arm64 The renderer is bundled by esbuild into `src/renderer/index.js` and `index.css`. Those are generated files, are not committed, and are rebuilt by `npm install`, `npm start` and every `npm run dist` — so there is no bundling step to remember after changing `src/renderer/index.jsx` or the components and hooks it imports from `src/renderer/components/` and `src/renderer/hooks/`. `npm run build:once` still exists if you want to rebuild on its own. -Output goes to `dist/`. On Linux, `npm run dist` creates an AppImage, a `.deb` and an `.rpm`; building the `.rpm` needs `rpmbuild` (the `rpm` package on Debian and Ubuntu). The deb and rpm packages are not published yet, until [#782](https://github.com/WordPress/contributor-toolkit/issues/782) has tested the bundled Git inside them. macOS packages use the build machine's architecture, and the published macOS builds currently target Apple Silicon (`arm64`) only. +Output goes to `dist/`. On Linux, `npm run dist` creates an AppImage, a `.deb` and an `.rpm`; building the `.rpm` needs `rpmbuild` (the `rpm` package on Debian and Ubuntu). macOS packages use the build machine's architecture, and the published macOS builds currently target Apple Silicon (`arm64`) only. ### App icon diff --git a/RELEASING.md b/RELEASING.md index 9175ea7e..17c21e8f 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -38,7 +38,7 @@ Versions are `X.Y.Z` for a stable release and `X.Y.Z-beta.N` for a beta. Tags ad Buildkite builds signed Windows, macOS and Linux artifacts for the pull request's branch. Before merging, open the build for the pull request's **current head commit** (`gh pr view --json headRefOid --jq .headRefOid`), download the three files into one directory, and check them. Buildkite reports nothing back to the pull request (`.buildkite/pipeline.yml` asks for a commit status per platform, but none reached the 2.0.0 bump pull request), so the commit can only be read on the build's page in Buildkite: compare it with `headRefOid` there, by eye. -- The files are named `wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, `wordpress-contributor-toolkit-X.Y.Z-mac-arm64.dmg` and `wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.AppImage`. The Windows file may download as `dist_wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, because the Windows build uploads it from `dist\`. Rename it to remove the `dist_` prefix, so its name matches the other two. The Linux build also lists a `.deb` and an `.rpm`; leave them out of the release until [#782](https://github.com/WordPress/contributor-toolkit/issues/782) has tested the bundled Git inside them. +- The files are named `wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, `wordpress-contributor-toolkit-X.Y.Z-mac-arm64.dmg` and `wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.AppImage`. The Windows file may download as `dist_wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, because the Windows build uploads it from `dist\`. Rename it to remove the `dist_` prefix, so its name matches the other two. - The macOS app is signed with Automattic's Developer ID, notarized, and has its ticket stapled. - The Windows installer carries an Authenticode signature from Automattic Inc. - The app's `app.asar` root holds exactly `node_modules`, `package.json` and `src`, with npm 11 under `node_modules/npm` and no `.codesigning` directory. From c5df2b754b28b1adfc833ef705bc3f9febf697de Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Tue, 17 Nov 2026 12:34:33 +0200 Subject: [PATCH 4/4] Add the deb and rpm to the release procedure A release now downloads, attaches and checks five files: the deb and rpm join the Windows, macOS and AppImage installers. The release skill wrappers ask for five files to match. Co-Authored-By: Claude Opus 5.5 --- .agents/skills/release/SKILL.md | 2 +- .claude/skills/release/SKILL.md | 2 +- RELEASING.md | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.agents/skills/release/SKILL.md b/.agents/skills/release/SKILL.md index 92057772..4593ee33 100644 --- a/.agents/skills/release/SKILL.md +++ b/.agents/skills/release/SKILL.md @@ -29,7 +29,7 @@ The merge is the person's. Wait to be told it is merged, unless the person asks **The bump pull request is an ordinary pull request.** Fill in `.github/pull_request_template.md` and run the review AGENTS.md requires before opening it. -**The person downloads the artifacts; this skill checks them.** This skill cannot see Buildkite: the build reports nothing to the pull request. Ask the person to confirm that the build's commit matches the pull request's current head, and to download the three files from it into a directory they name. Then run the checks in section 2 of `RELEASING.md`, *Check the signed artifacts*, and report each result. Do not report the build as matching the head until the person has said it does. +**The person downloads the artifacts; this skill checks them.** This skill cannot see Buildkite: the build reports nothing to the pull request. Ask the person to confirm that the build's commit matches the pull request's current head, and to download the five files from it into a directory they name. Then run the checks in section 2 of `RELEASING.md`, *Check the signed artifacts*, and report each result. Do not report the build as matching the head until the person has said it does. **Draft the release notes once the pull request is merged.** Write them plainly, save them to a temporary directory outside the repository, and show them in the chat for editing before `gh release create` (item 4 above). diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md index a547e5b4..591820b5 100644 --- a/.claude/skills/release/SKILL.md +++ b/.claude/skills/release/SKILL.md @@ -29,7 +29,7 @@ The merge is the person's. Wait to be told it is merged, unless the person asks **The bump pull request is an ordinary pull request.** Fill in `.github/pull_request_template.md` and run the review AGENTS.md requires before opening it. -**The person downloads the artifacts; this skill checks them.** This skill cannot see Buildkite: the build reports nothing to the pull request. Ask the person to confirm that the build's commit matches the pull request's current head, and to download the three files from it into a directory they name. Then run the checks in section 2 of `RELEASING.md`, *Check the signed artifacts*, and report each result. Do not report the build as matching the head until the person has said it does. +**The person downloads the artifacts; this skill checks them.** This skill cannot see Buildkite: the build reports nothing to the pull request. Ask the person to confirm that the build's commit matches the pull request's current head, and to download the five files from it into a directory they name. Then run the checks in section 2 of `RELEASING.md`, *Check the signed artifacts*, and report each result. Do not report the build as matching the head until the person has said it does. **Draft the release notes once the pull request is merged.** Write them plainly, save them to a temporary directory outside the repository, and show them in the chat for editing before `gh release create` (item 4 above). diff --git a/RELEASING.md b/RELEASING.md index 17c21e8f..bdc5d7d8 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -36,9 +36,9 @@ Versions are `X.Y.Z` for a stable release and `X.Y.Z-beta.N` for a beta. Tags ad ## 2. Check the signed artifacts -Buildkite builds signed Windows, macOS and Linux artifacts for the pull request's branch. Before merging, open the build for the pull request's **current head commit** (`gh pr view --json headRefOid --jq .headRefOid`), download the three files into one directory, and check them. Buildkite reports nothing back to the pull request (`.buildkite/pipeline.yml` asks for a commit status per platform, but none reached the 2.0.0 bump pull request), so the commit can only be read on the build's page in Buildkite: compare it with `headRefOid` there, by eye. +Buildkite builds signed Windows, macOS and Linux artifacts for the pull request's branch. Before merging, open the build for the pull request's **current head commit** (`gh pr view --json headRefOid --jq .headRefOid`), download the five files into one directory, and check them. Buildkite reports nothing back to the pull request (`.buildkite/pipeline.yml` asks for a commit status per platform, but none reached the 2.0.0 bump pull request), so the commit can only be read on the build's page in Buildkite: compare it with `headRefOid` there, by eye. -- The files are named `wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, `wordpress-contributor-toolkit-X.Y.Z-mac-arm64.dmg` and `wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.AppImage`. The Windows file may download as `dist_wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, because the Windows build uploads it from `dist\`. Rename it to remove the `dist_` prefix, so its name matches the other two. +- The files are named `wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, `wordpress-contributor-toolkit-X.Y.Z-mac-arm64.dmg`, `wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.AppImage`, `wordpress-contributor-toolkit-X.Y.Z-linux-amd64.deb` and `wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.rpm`. The Windows file may download as `dist_wordpress-contributor-toolkit-X.Y.Z-win-x64.exe`, because the Windows build uploads it from `dist\`. Rename it to remove the `dist_` prefix, so its name matches the others. - The macOS app is signed with Automattic's Developer ID, notarized, and has its ticket stapled. - The Windows installer carries an Authenticode signature from Automattic Inc. - The app's `app.asar` root holds exactly `node_modules`, `package.json` and `src`, with npm 11 under `node_modules/npm` and no `.codesigning` directory. @@ -118,7 +118,9 @@ gh release create vX.Y.Z \ --notes-file "/notes.md" \ "/wordpress-contributor-toolkit-X.Y.Z-win-x64.exe" \ "/wordpress-contributor-toolkit-X.Y.Z-mac-arm64.dmg" \ - "/wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.AppImage" + "/wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.AppImage" \ + "/wordpress-contributor-toolkit-X.Y.Z-linux-amd64.deb" \ + "/wordpress-contributor-toolkit-X.Y.Z-linux-x86_64.rpm" ``` - **A beta** adds `--prerelease`, so `releases/latest` stays on the last stable release. @@ -161,7 +163,7 @@ The first two list the issues and pull requests still open, the third finds the ## 7. Check the result -- `gh release view vX.Y.Z` lists the three files under the names from step 2, and shows the release as a pre-release only for a beta. +- `gh release view vX.Y.Z` lists the five files under the names from step 2, and shows the release as a pre-release only for a beta. - `gh api repos/WordPress/contributor-toolkit/releases/latest --jq .tag_name` prints `vX.Y.Z` for a stable release, and the previous stable tag for a beta. - `git ls-remote origin refs/tags/vX.Y.Z` points at the bump commit. - For a stable release, the docs run from step 5 finished with its deploy job.