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/.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/.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/README.md b/README.md index acab06e1..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. 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 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. diff --git a/package.json b/package.json index 2cbeaf8e..64511581 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.desktop", "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), 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`); +});