|
| 1 | +--- |
| 2 | +name: playwright-java-release |
| 3 | +description: Prepare a Playwright Java release after the rolling PR has merged — cut the release branch, mark the Maven version, draft the GitHub release, and tick the Java boxes in the internal checklist. |
| 4 | +--- |
| 5 | + |
| 6 | +Use this skill once the `chore: roll driver to 1.X.0` PR has merged into `main` and the upstream JS `v1.X.0` is published. The rolling work itself is covered by the [[playwright-roll]] skill. |
| 7 | + |
| 8 | +Throughout this doc, replace `X` with the minor version (e.g. `60` for `1.60.0`) and `<user>` with the fork owner (`gh api user --jq .login`). |
| 9 | + |
| 10 | +The full release checklist lives in the private `microsoft/playwright-internal` repo as the `v1.X checklist` issue. Find its number once: |
| 11 | + |
| 12 | +```bash |
| 13 | +unset GITHUB_TOKEN |
| 14 | +ISSUE=$(gh search issues --repo microsoft/playwright-internal "v1.X checklist" --json number --jq '.[0].number') |
| 15 | +``` |
| 16 | + |
| 17 | +Tick each Java box incrementally (one PATCH per item) so the issue reflects accurate state if the flow is interrupted: |
| 18 | + |
| 19 | +```bash |
| 20 | +gh api repos/microsoft/playwright-internal/issues/$ISSUE --jq '.body' > /tmp/body.md |
| 21 | +# edit /tmp/body.md to flip "- [ ]" → "- [x]" on the relevant Java item |
| 22 | +gh api repos/microsoft/playwright-internal/issues/$ISSUE -X PATCH --field body=@/tmp/body.md |
| 23 | +``` |
| 24 | + |
| 25 | +## 1. Cut the release branch |
| 26 | + |
| 27 | +Push `release-1.X` from current `upstream/main` (which now contains the merged roll commit): |
| 28 | + |
| 29 | +```bash |
| 30 | +git fetch upstream main |
| 31 | +git push upstream upstream/main:refs/heads/release-1.X |
| 32 | +``` |
| 33 | + |
| 34 | +## 2. Draft the GitHub release |
| 35 | + |
| 36 | +Generate the release notes from the upstream docs: |
| 37 | + |
| 38 | +```bash |
| 39 | +cd ~/playwright |
| 40 | +node utils/render_release_notes.mjs java 1.X > /tmp/v1.X.0-release-notes.md |
| 41 | +``` |
| 42 | + |
| 43 | +The renderer leaves JS-isms that need fixing for Java. Apply these substitutions — the list is not exhaustive, eyeball the diff before publishing: |
| 44 | + |
| 45 | +- `toMatchAriaSnapshot()` → `matchesAriaSnapshot()` |
| 46 | +- `toHaveCSS()` → `hasCSS()` (and other `toHaveX` matchers → `hasX`) |
| 47 | +- `browser.on('context')` → `browser.onContext()` |
| 48 | +- `browserContext.on('download' | 'frameattached' | ...)` → `browserContext.onDownload()` / `onFrameAttached()` / … |
| 49 | + |
| 50 | +Create the draft directly against `release-1.X` — drafting against `main` and retargeting later is fragile because every `gh release edit` rotates the `untagged-<hash>` ID: |
| 51 | + |
| 52 | +```bash |
| 53 | +gh release create v1.X.0 --repo microsoft/playwright-java --draft \ |
| 54 | + --title "v1.X.0" --notes-file /tmp/v1.X.0-release-notes.md --target release-1.X |
| 55 | +``` |
| 56 | + |
| 57 | +## 3. Bump the Maven version on the release branch |
| 58 | + |
| 59 | +Cut `mark-v-1.X.0` off `upstream/release-1.X`, run `set_maven_version.sh`, and PR back to the release branch: |
| 60 | + |
| 61 | +```bash |
| 62 | +git checkout -b mark-v-1.X.0 upstream/release-1.X |
| 63 | +./scripts/set_maven_version.sh 1.X.0 |
| 64 | +git add -u |
| 65 | +git commit -m "chore: mark 1.X.0" |
| 66 | +git push -u origin mark-v-1.X.0 |
| 67 | +gh pr create --repo microsoft/playwright-java --head <user>:mark-v-1.X.0 --base release-1.X \ |
| 68 | + --title "chore: mark 1.X.0" \ |
| 69 | + --body "Updates Maven version in all modules to \`1.X.0\` for the v1.X release." |
| 70 | +``` |
| 71 | + |
| 72 | +`set_maven_version.sh` only invokes `mvn versions:set` on `pom.xml`, `tools/*/pom.xml`, and `examples/pom.xml`, but the root invocation cascades through the reactor, so the expected diff is 11 poms: root + `driver/` + `driver-bundle/` + `playwright/` (from the reactor cascade) + 6 under `tools/` + `examples/`, all flipping `1.<prev>.0-SNAPSHOT` → `1.X.0`. Any other file in the diff is a red flag. |
| 73 | + |
| 74 | +## 4. Publish |
| 75 | + |
| 76 | +The user publishes the draft release manually once the `mark-v-1.X.0` PR is merged. After publishing, CI pushes the artifacts to Maven Central and runs the Docker workflow automatically: https://github.com/microsoft/playwright-java/actions. |
| 77 | + |
| 78 | +## Authenticated access to the internal checklist |
| 79 | + |
| 80 | +The default `GITHUB_TOKEN` in this environment lacks the `repo` scope needed to read/edit private `microsoft/playwright-internal` issues, so direct `gh` calls return 404. The user's personal `gh` token in `~/.config/gh/hosts.yml` has the needed scope; `unset GITHUB_TOKEN; gh ...` falls back to it. Do not try to pass the OAuth token explicitly via env vars — the sandbox blocks that as credential exploration. |
0 commit comments