Skip to content

Commit 5e93d99

Browse files
chore: update our release process
1 parent 3249e78 commit 5e93d99

14 files changed

Lines changed: 845 additions & 1509 deletions

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/full-berries-read.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"h2m-parser": minor
3+
---
4+
5+
Fast HTML to Markdown converter with Mozilla Readability extraction, streaming renderer, and LLM-ready output. 3.75x faster than alternatives

.github/workflows/performance-regression.yml

Lines changed: 87 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,41 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
performance-check:
17+
regression:
18+
if: github.event_name == 'pull_request'
1819
runs-on: ubuntu-latest
1920

2021
steps:
21-
- name: Checkout PR
22-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
22+
- name: Checkout repository
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2324
with:
2425
persist-credentials: false
2526

2627
- name: Setup Node.js
27-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
28+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
2829
with:
29-
node-version: '20'
30+
node-version: '24'
31+
32+
- name: Enable Corepack
33+
run: corepack enable
3034

3135
- name: Setup pnpm
3236
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
3337
with:
34-
version: 10.17.1
38+
run_install: false
3539

3640
- name: Install dependencies
3741
run: pnpm install --frozen-lockfile
3842

3943
- name: Build project
4044
run: pnpm build
4145

42-
- name: Checkout main branch baseline
43-
if: github.event_name == 'pull_request'
46+
- name: Restore main baseline
4447
run: |
45-
git fetch origin main
48+
git fetch origin main --depth=1
4649
git checkout origin/main -- bench/.baseline/performance-baseline.json || true
47-
git checkout -
48-
49-
- name: Capture baseline (main branch only)
50-
if: github.ref == 'refs/heads/main'
51-
run: node bench/capture-baseline.js
5250
5351
- name: Check for regressions
54-
if: github.event_name == 'pull_request'
5552
id: regression-check
5653
run: |
5754
if node bench/check-regression.js; then
@@ -61,59 +58,58 @@ jobs:
6158
fi
6259
6360
- name: Upload regression report
64-
if: github.event_name == 'pull_request' && always()
61+
if: always()
6562
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6663
with:
6764
name: regression-report
6865
path: bench/.results/regression-report.md
66+
if-no-files-found: ignore
6967

7068
- name: Comment PR with results
71-
if: github.event_name == 'pull_request' && always()
72-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0
69+
if: always()
70+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
7371
with:
7472
script: |
7573
const fs = require('fs');
7674
const path = require('path');
75+
const reportPath = path.join(process.env.GITHUB_WORKSPACE, 'bench', '.results', 'regression-report.md');
7776
78-
try {
79-
const reportPath = path.join(process.env.GITHUB_WORKSPACE, 'bench', '.results', 'regression-report.md');
80-
if (fs.existsSync(reportPath)) {
81-
const report = fs.readFileSync(reportPath, 'utf8');
82-
83-
// Find existing comment
84-
const { data: comments } = await github.rest.issues.listComments({
85-
owner: context.repo.owner,
86-
repo: context.repo.repo,
87-
issue_number: context.issue.number,
88-
});
89-
90-
const botComment = comments.find(comment =>
91-
comment.user.type === 'Bot' &&
92-
comment.body.includes('Performance Regression Report')
93-
);
94-
95-
const body = `🤖 **Performance Check Results**\n\n${report}`;
96-
97-
if (botComment) {
98-
// Update existing comment
99-
await github.rest.issues.updateComment({
100-
owner: context.repo.owner,
101-
repo: context.repo.repo,
102-
comment_id: botComment.id,
103-
body
104-
});
105-
} else {
106-
// Create new comment
107-
await github.rest.issues.createComment({
108-
owner: context.repo.owner,
109-
repo: context.repo.repo,
110-
issue_number: context.issue.number,
111-
body
112-
});
113-
}
114-
}
115-
} catch (error) {
116-
console.error('Failed to comment on PR:', error);
77+
if (!fs.existsSync(reportPath)) {
78+
return;
79+
}
80+
81+
const report = fs.readFileSync(reportPath, 'utf8');
82+
const body = `🤖 **Performance Check Results**
83+
84+
${report}`;
85+
86+
const response = await github.rest.issues.listComments({
87+
owner: context.repo.owner,
88+
repo: context.repo.repo,
89+
issue_number: context.issue.number,
90+
});
91+
92+
const comments = response.data;
93+
94+
const botComment = comments.find(comment =>
95+
comment.user.type === 'Bot' &&
96+
comment.body.includes('Performance Check Results')
97+
);
98+
99+
if (botComment) {
100+
await github.rest.issues.updateComment({
101+
owner: context.repo.owner,
102+
repo: context.repo.repo,
103+
comment_id: botComment.id,
104+
body,
105+
});
106+
} else {
107+
await github.rest.issues.createComment({
108+
owner: context.repo.owner,
109+
repo: context.repo.repo,
110+
issue_number: context.issue.number,
111+
body,
112+
});
117113
}
118114
119115
- name: Fail if regression detected
@@ -122,8 +118,40 @@ jobs:
122118
echo "❌ Performance regression detected! See report above."
123119
exit 1
124120
125-
- name: Commit baseline updates (main branch only)
126-
if: github.ref == 'refs/heads/main'
121+
update-baseline:
122+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
123+
runs-on: ubuntu-latest
124+
125+
steps:
126+
- name: Checkout repository
127+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
128+
with:
129+
fetch-depth: 0
130+
persist-credentials: false
131+
132+
- name: Setup Node.js
133+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
134+
with:
135+
node-version: '24'
136+
137+
- name: Enable Corepack
138+
run: corepack enable
139+
140+
- name: Setup pnpm
141+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
142+
with:
143+
run_install: false
144+
145+
- name: Install dependencies
146+
run: pnpm install --frozen-lockfile
147+
148+
- name: Build project
149+
run: pnpm build
150+
151+
- name: Capture baseline
152+
run: node bench/capture-baseline.js
153+
154+
- name: Commit baseline updates
127155
run: |
128156
git config --local user.email "action@github.com"
129157
git config --local user.name "GitHub Action"

.github/workflows/publish-tag.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
release:
1818
name: Release
1919
runs-on: ubuntu-latest
20+
environment:
21+
name: release
22+
url: https://www.npmjs.com/package/h2m-parser
2023
steps:
2124
- name: Checkout
2225
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
@@ -26,15 +29,14 @@ jobs:
2629

2730
- name: Setup pnpm
2831
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
29-
with:
30-
version: 10.17.1
3132

3233
- name: Setup Node.js
3334
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
3435
with:
35-
node-version: 20
36+
node-version: 24
3637
cache: 'pnpm'
3738
registry-url: 'https://registry.npmjs.org'
39+
always-auth: true
3840

3941
- name: Install dependencies
4042
run: pnpm install --frozen-lockfile
@@ -57,7 +59,7 @@ jobs:
5759
createGithubReleases: true
5860
env:
5961
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || '' }} # TODO: remove when OIDC is configured
62+
NPM_CONFIG_PROVENANCE: 'true'
6163

6264
- name: Publish notification
6365
if: steps.changesets.outputs.published == 'true'

.github/workflows/test.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
contents: read
1818
strategy:
1919
matrix:
20-
node: [20, 22]
20+
node: [22, 24]
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
@@ -26,8 +26,6 @@ jobs:
2626

2727
- name: Setup pnpm
2828
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda #v4.1.0
29-
with:
30-
version: 10.17.1
3129

3230
- name: Setup Node.js ${{ matrix.node }}
3331
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
@@ -65,13 +63,11 @@ jobs:
6563

6664
- name: Setup pnpm
6765
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda #v4.1.0
68-
with:
69-
version: 10.17.1
7066

7167
- name: Setup Node.js
7268
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 #v5.0.0
7369
with:
74-
node-version: 20
70+
node-version: 24
7571
cache: 'pnpm'
7672

7773
- name: Install dependencies

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ node_modules
22
.DS_Store
33
dist
44
coverage
5-
.results
65
.bench
7-
bench/.results
86
bench/output
97
fixtures/
108
.vscode
@@ -13,9 +11,6 @@ fixtures/
1311
.env*
1412
.nyc_output
1513

16-
# Changeset state
17-
.changeset
18-
1914
# TypeDoc generated documentation
2015
docs/api
2116
docs/api-markdown

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Thanks for your interest in improving h2m-parser! Keeping cognitive load low is
2121

2222
- Husky runs `lint-staged` to format/lint staged files. Make sure your commits are clean.
2323
- Use [Changesets](https://github.com/changesets/changesets) for release notes. After feature work, run `pnpm changeset` to document changes and version bumps.
24+
- When the release PR opens, review the changelog and, after merging, approve the pending run in the `release` environment to publish.
2425
- CI runs `pnpm lint`, `pnpm typecheck`, `pnpm test`, and `pnpm build`. Keep the `verify` script green locally before pushing.
2526

2627
## Reporting issues

0 commit comments

Comments
 (0)