Skip to content

Commit 0023cfa

Browse files
committed
ci: add release-please and pull request title check
1 parent c35474d commit 0023cfa

10 files changed

Lines changed: 227 additions & 1 deletion

‎.github/CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ This fixes #20 by removing styles that leaked which would cause the page to turn
5858

5959
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
6060

61-
If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
61+
4. **A [Conventional Commits](https://www.conventionalcommits.org/) title**, for example `fix(web): show session times in the event time zone`. Pull requests are squash merged and the title becomes the release note, so mark breaking changes with `!` and explain them in the description. See [docs/releases.md](../docs/releases.md#pull-requests).
6262

6363
_Copied from [Polymer Elements contributing guide](https://github.com/PolymerElements/ContributionGuide)_

‎.github/dependabot.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ updates:
44
directory: '/'
55
schedule:
66
interval: monthly
7+
commit-message:
8+
prefix: ci
79
- package-ecosystem: npm
810
directories:
911
- '/'
@@ -13,6 +15,9 @@ updates:
1315
- '/packages/storage'
1416
schedule:
1517
interval: monthly
18+
commit-message:
19+
prefix: chore
20+
include: scope
1621
open-pull-requests-limit: 25
1722
groups:
1823
rollup:

‎.github/workflows/pr-title.yaml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PR Title
2+
on:
3+
# Only reads the PR title and never checks out PR code, so pull_request_target is safe here.
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
conventional-commit:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v6
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Please
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v5
17+
with:
18+
# Falls back to GITHUB_TOKEN, which does not trigger CI on the release PR.
19+
token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}

‎.release-please-manifest.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "3.1.0"
3+
}

‎AGENTS.md‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# AGENTS.md
2+
3+
Hoverboard is a conference website template. Organizers fork it, configure it and deploy it to their own Firebase project. The web app is built with Lit and Vite, data lives in Firestore, and Cloud Functions handle schedule generation, notifications, image optimization and Mailchimp.
4+
5+
## Layout
6+
7+
| Path | What it is |
8+
| --------------------------- | -------------------------------------------------------------------------------------------- |
9+
| `packages/web` | The web app: Lit components, Redux Toolkit store, Vite build, Workbox service worker |
10+
| `packages/server/functions` | Cloud Functions (v2 API). Must stay self-contained, because `firebase.json` deploys it alone |
11+
| `packages/cli` | The `hbd` CLI (`./hbd <command>`), run with `tsx`, no build step |
12+
| `packages/storage` | Firestore and Storage security rules, indexes, and the rules tests |
13+
| `config/` | Build-time site config (`development.json`, `production.json`), selected by `BUILD_ENV` |
14+
| `packages/web/public/data/` | Site text and settings (`resources.json`, `settings.json`), FAQ, code of conduct, blog posts |
15+
| `docs/` | Tutorials and the release policy |
16+
17+
Each package has its own `package.json` and `package-lock.json`. The root is a thin orchestrator: its scripts delegate with `npm --prefix ./packages/<name>`.
18+
19+
## Setup
20+
21+
- Node.js and npm versions come from `engines` in the root `package.json`. CI uses the same file.
22+
- `npm ci` at the root also installs every package through `postinstall`.
23+
- Java is needed for the Firestore emulator, which the rules tests and `npm start` use.
24+
- Some commands expect a `serviceAccount.json` at the root. For local checks, `echo "{}" > serviceAccount.json` is enough. Never commit a real one.
25+
26+
## Commands
27+
28+
Run from the repo root.
29+
30+
| Command | Does |
31+
| ------------------------------ | ------------------------------------------------------------------------------------ |
32+
| `npm test` | All Vitest projects: Web, Functions, CLI, Firestore (starts the emulator) |
33+
| `npx vitest run --project Web` | One project. Add a path to run one file |
34+
| `npm run lint` | ESLint, Prettier, syncpack, lit-analyzer and type checks for web, server and storage |
35+
| `npm run fix` | ESLint and Prettier autofix |
36+
| `npm run build` | Production build of the web app to `packages/web/dist` |
37+
| `npm start` | Emulators, functions and web app in watch mode |
38+
| `./hbd doctor` | Checks the local setup, Firebase login, project and billing plan |
39+
40+
Before finishing a change, run `npm run lint` and `npm test`, or at least the affected Vitest project and type check.
41+
42+
## Conventions
43+
44+
- **TypeScript** is strict, with `verbatimModuleSyntax`. Use `import type` for type-only imports. Custom elements register as a side effect, so import them with `import './my-element'` where they are used.
45+
- **Components** use `@customElement`, extend `ThemedElement` (which adds the shared theme styles), and read store state with the `@fromStore` decorator. Use theme CSS variables from `src/styles/theme.ts`, not hard-coded colors.
46+
- **Tests** sit next to the code as `*.test.ts`. Web tests run in jsdom: render with `fixture` from `packages/web/__tests__/helpers/fixtures.ts`, set state with `setStoreState`, and assert with the jest-dom matchers. Every bug fix or feature needs a test.
47+
- **Vitest** is configured once in the root `vitest.config.ts`. Do not add `vitest` to a package's `package.json`, because a second copy breaks `expect.extend` from setup files.
48+
- **Dependencies** shared by several packages must use the same version range. `npm run lint:syncpack` checks this.
49+
- **Paths.** Vite runs with `packages/web` as the working directory, so its relative paths resolve from there. `config/` is two levels up.
50+
- **Firestore commands** (`./hbd firestore-*`) use the emulator by default. Only target production with `FIRESTORE_TARGET=production` when explicitly asked.
51+
- **Formatting.** Prettier formats everything, including Markdown, JSON and YAML. Run `npx prettier --write <files>` after editing them.
52+
- **Docs** use short, plain sentences. Mark claims that were not tested with "verify".
53+
54+
## Pull requests and releases
55+
56+
- Pull request titles follow [Conventional Commits](https://www.conventionalcommits.org/), for example `fix(web): show session times in the event time zone`. They are squash merged, and the title becomes the release note.
57+
- Mark breaking changes with `!` and explain what organizers must do in a `BREAKING CHANGE:` paragraph. [docs/releases.md](docs/releases.md) defines what counts as breaking.
58+
- release-please opens the release pull request and updates [CHANGELOG.md](CHANGELOG.md). Do not edit the changelog by hand.
59+
60+
## Do not commit
61+
62+
- `serviceAccount.json`, `*-adminsdk-*.json`, `.firebaserc`, or any other credentials.
63+
- Emulator debug logs (`*-debug.log`).
64+
- `NEXT.md` and the planning specs in `docs/` that it lists. They are local working documents. Do not link to them from committed files.

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
Release notes are generated by [release-please](https://github.com/googleapis/release-please) from pull request titles. See [docs/releases.md](docs/releases.md).
4+
5+
## [3.1.0](https://github.com/gdg-x/hoverboard/releases/tag/v3.1.0) (2026-09-08)
6+
7+
Final v3 release. Earlier releases are listed on [GitHub](https://github.com/gdg-x/hoverboard/releases).

‎docs/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@
1010
- [Notifications](tutorials/05-notifications.md)
1111
- [MailChimp auto subscription](tutorials/07-mailchimp-autosubscribe.md)
1212
- [Firestore utils](tutorials/firebase-utils.md)
13+
14+
## Maintainers
15+
16+
- [Releases](releases.md)

‎docs/releases.md‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Releases
2+
3+
How Hoverboard is versioned and released, and what counts as a breaking change.
4+
5+
## Versioning
6+
7+
Hoverboard uses [semantic versioning](https://semver.org/). The whole repo has one version, kept in the root [package.json](../package.json) and tagged as `vX.Y.Z`. The packages in `packages/` are private and not published, so their own `version` fields are not release versions.
8+
9+
A version describes the impact of an update on a site that runs Hoverboard.
10+
11+
### Major: breaking changes
12+
13+
Anything that makes an organizer change something to keep their site working after updating:
14+
15+
- **Config.** Removing or renaming a key, changing its meaning or type, or adding a required key with no default. This covers `site.json`, the content files and `schemaVersion`.
16+
- **Content files.** Changing the location or format of `resources.json`, markdown pages, blog posts or images.
17+
- **Firestore data.** Renaming or removing a collection or field, changing a field's type, or adding a required field.
18+
- **Security rules.** Firestore or Storage rules that reject data or requests that were allowed before.
19+
- **Functions.** Removing or renaming a function, changing its trigger, or requiring a new secret, API or Firebase service.
20+
- **CLI.** Removing or renaming an `hbd` command or flag, or changing a default in a way that changes the result.
21+
- **Requirements.** Raising the minimum Node.js version in `engines`, requiring a different Firebase plan, or dropping a supported browser.
22+
- **URLs.** Removing or changing a route without a redirect, which breaks shared links and search results.
23+
24+
### Minor: features
25+
26+
New features, new optional config keys with defaults, new built-in themes, new locales, new `hbd` commands and flags, and deprecations.
27+
28+
### Patch: fixes
29+
30+
Bug fixes, security fixes, translation fixes, and dependency updates with no change in behavior.
31+
32+
## Breaking changes
33+
34+
Every breaking change must:
35+
36+
- Use `!` in the pull request title, for example `feat(config)!: rename event.dates`.
37+
- Explain what organizers need to do in a `BREAKING CHANGE:` paragraph at the end of the pull request description. It becomes part of the release notes.
38+
- From v4 on, ship an `hbd upgrade` migration for config and Firestore data changes, with tests against the previous shape.
39+
40+
When possible, deprecate first: keep the old behavior working in a minor release with a warning from the build or `hbd doctor`, then remove it in the next major.
41+
42+
## Pull requests
43+
44+
Pull requests are squash merged, and the title becomes the commit message. Titles follow [Conventional Commits](https://www.conventionalcommits.org/), which the [PR Title](../.github/workflows/pr-title.yaml) check enforces.
45+
46+
| Type | Use for | In release notes | Version bump |
47+
| ---------- | --------------------------------------------- | ---------------- | ------------ |
48+
| `feat` | A new feature for organizers or attendees | Features | Minor |
49+
| `fix` | A bug fix | Bug Fixes | Patch |
50+
| `perf` | A performance improvement | Performance | Patch |
51+
| `revert` | Reverting an earlier change | Reverts | Patch |
52+
| `docs` | Documentation and tutorials | Documentation | None |
53+
| `refactor` | Code changes with no change in behavior | Hidden | None |
54+
| `test` | Tests only | Hidden | None |
55+
| `build` | Build tooling | Hidden | None |
56+
| `ci` | Workflows | Hidden | None |
57+
| `chore` | Everything else, including dependency updates | Hidden | None |
58+
| `style` | Formatting only | Hidden | None |
59+
60+
Any type with `!` is a major bump. Scopes are optional. Use the package or area, for example `web`, `functions`, `cli`, `storage`, `config` or `deps`.
61+
62+
Write titles for organizers reading the release notes: `fix(web): show session times in the event time zone`, not `fix: tz bug`.
63+
64+
## Making a release
65+
66+
[release-please](https://github.com/googleapis/release-please) runs on every push to `main` ([workflow](../.github/workflows/release-please.yaml), [config](../release-please-config.json)). It keeps one release pull request open that bumps the version and adds the new notes to [CHANGELOG.md](../CHANGELOG.md). Merging that pull request tags the release and publishes a GitHub release.
67+
68+
- Merge the release pull request when the release is ready. There is no fixed schedule. Fixes should be released soon after they land.
69+
- Until v4 ships, `release-as` in the config pins the release pull request to `4.0.0`, so it collects the v4 notes as work lands. Remove `release-as` in the pull request that releases v4.
70+
- Pull requests created with the default `GITHUB_TOKEN` do not trigger other workflows. To run CI on the release pull request, add a `RELEASE_PLEASE_TOKEN` secret with a fine-grained token that can write contents and pull requests.
71+
72+
Repository settings this process depends on:
73+
74+
- Allow squash merging only, with the default commit message set to the pull request title and description.
75+
- Allow GitHub Actions to create and approve pull requests (Settings, Actions, General).
76+
77+
## Supported versions
78+
79+
Only the latest major version gets fixes. v3 ended at v3.1.0, and there will be no more 3.x releases. Pre-v4 sites relaunch on v4 and move their content over by hand.

‎release-please-config.json‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"bootstrap-sha": "80395b0ccc6e08cc1f0cdff50186ee119aad0b24",
4+
"packages": {
5+
".": {
6+
"release-type": "node",
7+
"package-name": "hoverboard",
8+
"include-component-in-tag": false,
9+
"release-as": "4.0.0",
10+
"changelog-sections": [
11+
{ "type": "feat", "section": "Features" },
12+
{ "type": "fix", "section": "Bug Fixes" },
13+
{ "type": "perf", "section": "Performance" },
14+
{ "type": "revert", "section": "Reverts" },
15+
{ "type": "docs", "section": "Documentation" },
16+
{ "type": "refactor", "section": "Refactors", "hidden": true },
17+
{ "type": "test", "section": "Tests", "hidden": true },
18+
{ "type": "build", "section": "Build", "hidden": true },
19+
{ "type": "ci", "section": "CI", "hidden": true },
20+
{ "type": "chore", "section": "Chores", "hidden": true },
21+
{ "type": "style", "section": "Style", "hidden": true }
22+
]
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)