Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 33 additions & 32 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,54 +185,55 @@ No watching of HTML changes for now to avoid extra complexity.

### Prerequisites

- [`gh` CLI](https://cli.github.com/) installed and authenticated (`gh auth login`)
- `$EDITOR` environment variable set (e.g. `export EDITOR=vim` in your shell profile)
- npm Trusted Publisher configured on npmjs.com
- Maintain permission on the GitHub repository (required to push tags)
- Maintain permission on the GitHub repository (required to push tags and run the workflow)
- npm publishing credentials configured for the repository

### Release flow
`publish` is the release branch and the repository default. `main` tracks the upstream
project and is not part of this flow.

#### 1. Prepare the release (run locally)
### Release flow

```sh
yarn release
```
#### 1. Open a release PR against `publish`

The script will:
On a branch off `publish`:

1. Validate prerequisites (`$EDITOR`, `gh` auth, clean working tree)
2. Sync with main and install latest deps
3. Prompt you to choose a version bump (patch / minor / major / custom)
4. Generate a changelog draft and open it in `$EDITOR` for review
5. Create a `release/vX.Y.Z` branch, commit, push, and create an annotated tag `vX.Y.Z`
6. Open a GitHub PR
- Set the new version in `package.json` — it is the source of truth, and the publish
workflow refuses to run if the tag does not match it.
- Add the matching `## [X.Y.Z]` section to `CHANGELOG.md`. The workflow extracts this
section verbatim as the GitHub release notes, so it stops at the next `## ` heading.
- Leave already-released sections alone. Compare against `git show vX.Y.Z:CHANGELOG.md`
to confirm a published section still says what that version actually shipped.

**Dry-run mode** (validates all checks and previews changelog without git changes):
Run the same gates the workflow runs, so a failure surfaces before the release:

```sh
yarn release --dry-run
yarn typecheck && yarn build && yarn test:unit && yarn format:check
```

#### 2. Review and merge the PR
Merge the PR once CI is green.

- Review the generated changelog in the PR
- Edit `CHANGELOG.md` if needed (push commits directly to the release branch)
#### 2. Tag the merge commit

> **⚠️ Warning:** The release tag is created **before** the PR is merged. If you push fixup commits to the release branch, you **must** move the tag to the latest commit before merging — otherwise those commits will be excluded from the published release:
>
> ```sh
> git tag -a -f vX.Y.Z -m "vX.Y.Z"
> git push -f origin vX.Y.Z
> ```
```sh
git checkout publish && git pull --ff-only
git tag -a vX.Y.Z -m "vX.Y.Z"
git push origin vX.Y.Z
```

Merge the PR when ready.
The tag must be on the merge commit, and `vX.Y.Z` must match `package.json`.

#### 3. Trigger the publish workflow
#### 3. Run the publish workflow from the tag

A Slack message in `#rum-electron-sdk-ops` is sent when the tag is pushed in step 1. It includes a link to the GitHub Actions publish workflow and reminds you to review and merge the PR first.
Actions → **Publish** → **Run workflow**, selecting the tag `vX.Y.Z` in the ref dropdown.

Open the workflow link, click **Run workflow**, and select the tag `vX.Y.Z` in the ref dropdown.
- `dry_run` runs the whole pipeline — build, gates, package contents — without publishing
to npm or creating a GitHub release. Use it first.
- `npm_tag` chooses the dist-tag. Publishing under `next` leaves `npm install` resolving to
whatever `latest` already points at, so a release can be staged. Promote it afterwards
without republishing:

> **Dry-run option:** Enable the `dry_run` toggle to run the full pipeline (build, validate, extract changelog) without publishing to npm or creating a GitHub release. Useful to validate the pipeline before the real publish.
```sh
npm dist-tag add @flashcatcloud/electron-sdk@X.Y.Z latest
```

[1]: https://gitmoji.carloscuesta.me/
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@
"test:integration": "playwright test -c e2e --grep @integration",
"lint": "eslint . --max-warnings 0",
"format": "prettier --write .",
"format:check": "prettier --check .",
"release": "node scripts/prepare-release.ts"
"format:check": "prettier --check ."
},
"devDependencies": {
"@eslint/js": "10.0.0",
Expand Down
10 changes: 0 additions & 10 deletions scripts/lib/semver.spec.ts

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/lib/semver.ts

This file was deleted.

160 changes: 0 additions & 160 deletions scripts/prepare-release.ts

This file was deleted.

Loading