Skip to content
Open
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
56 changes: 56 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release Please

# Automated versioning + changelog. As Conventional-Commit changes land on
# main, release-please maintains a "release" PR that bumps the version
# (package.json + manifest.json) and updates CHANGELOG.md. Merging that PR tags
# the version and creates a GitHub Release; this workflow then builds the
# browser packages and attaches them to that Release.
#
# The build/upload runs in this same workflow (not a separate one triggered by
# the release) because releases created with GITHUB_TOKEN don't trigger further
# workflow runs.
on:
push:
branches: [main]

concurrency:
group: release-please-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write # create the release + tag
pull-requests: write # open/update the release PR

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

# The steps below only run when the release PR was just merged.
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: ${{ steps.release.outputs.release_created == 'true' }}
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
if: ${{ steps.release.outputs.release_created == 'true' }}
with:
node-version: 20
cache: npm
- name: Install dependencies
if: ${{ steps.release.outputs.release_created == 'true' }}
run: npm ci
- name: Build + package (Chrome + Firefox zips)
if: ${{ steps.release.outputs.release_created == 'true' }}
run: npm run package
- name: Attach zips to the release
if: ${{ steps.release.outputs.release_created == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ steps.release.outputs.tag_name }}" \
focus-roast-chrome-*.zip \
focus-roast-firefox-*.zip \
--clobber
47 changes: 0 additions & 47 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,20 @@ change provider or key at any time via the ⚙ icon in the popup.

## Releases

Pre-built, ready-to-install packages for each version are attached to every
[GitHub Release](../../releases): `focus-roast-chrome-v<version>.zip` (Chrome /
Edge / Brave / Opera) and `focus-roast-firefox-v<version>.zip`.

Releases are automated: pushing a `v<version>` tag (matching `package.json`)
runs the [release workflow](.github/workflows/release.yml), which builds both
packages, zips them and publishes a Release with auto-generated notes.

```bash
# cut a release once package.json + manifest.json are on the new version
git tag v0.2.0
git push origin v0.2.0
```
Versioning and releases are automated with
[release-please](https://github.com/googleapis/release-please). As
Conventional-Commit changes (`feat:`, `fix:`, …) land on `main`, release-please
keeps a **release pull request** up to date that bumps the version in
`package.json` and `manifest.json` and updates `CHANGELOG.md`.

Merging that release PR (see
[the workflow](.github/workflows/release-please.yml)):

1. tags the version and creates a [GitHub Release](../../releases) with the
changelog notes;
2. builds both browser packages and attaches
`focus-roast-chrome-v<version>.zip` (Chrome / Edge / Brave / Opera) and
`focus-roast-firefox-v<version>.zip`.

So every version stays downloadable and installable without a local build. To
preview the zips locally, run `npm run package`.
16 changes: 16 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": false,
"packages": {
".": {
"release-type": "node",
"extra-files": [
{
"type": "json",
"path": "manifest.json",
"jsonpath": "$.version"
}
]
}
}
}
Loading