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
18 changes: 9 additions & 9 deletions .github/COPILOT_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ This is a **Home Assistant custom component** for integrating MiniBrew Craft and

1. **Automatic Release** (`.github/workflows/release.yml`)
- Triggers on push to main
- Uses semantic-release to determine version from commits
- Waits for all validation checks to pass before releasing
- Updates manifest.json version automatically
- Waits for all validation checks to pass, then runs Release Please
- Release Please opens/updates a release PR with the version bump (manifest.json) and CHANGELOG.md entry
- Merging the release PR tags the commit and publishes the GitHub release

2. **Draft Release** (`.github/workflows/draft-release.yml`)
- Manual workflow dispatch or preview tags (v*-preview*, v*-beta*, v*-alpha*, v*-rc*)
Expand Down Expand Up @@ -73,7 +73,7 @@ This is a **Home Assistant custom component** for integrating MiniBrew Craft and

### 8. Dependencies & Tools
- **Dependabot** configured for GitHub Actions and Python dependencies
- **Semantic-release** for version management
- **Release Please** for version management and release PRs
- **Commitlint** for commit message validation
- **Git hooks** for local validation (scripts/commit-msg)

Expand All @@ -85,7 +85,7 @@ This is a **Home Assistant custom component** for integrating MiniBrew Craft and

### 10. Key Files to Never Modify Without Care
- `manifest.json` - Must maintain exact structure and ordering
- `pyproject.toml` - Semantic-release configuration
- `release-please-config.json` / `.release-please-manifest.json` - Release Please configuration
- `.commitlintrc.json` - Commit validation rules
- Workflow files - Critical for CI/CD

Expand Down Expand Up @@ -125,26 +125,26 @@ Always include when relevant:
- Main branch is protected
- All changes via PRs
- PRs require conventional commit titles
- Auto-release on merge to main
- Release Please opens/updates a release PR; merging it tags and publishes the release
- Draft releases for manual review
- Preview releases for PR testing

## Development Setup
- Run `./scripts/setup-dev.sh` for environment setup
- Installs git hooks for commit validation
- Optional: semantic-release and commitlint tools
- Optional: commitlint tools

## When Making Changes
1. Always follow conventional commits
2. Update relevant documentation
3. Ensure validation checks pass
4. Consider if README needs updating
5. Check if manifest.json needs version bump (auto-handled by semantic-release)
5. Check if manifest.json needs version bump (auto-handled by Release Please)
6. No emojis anywhere

## File Paths Reference
- Integration: `custom_components/minibrew/`
- Workflows: `.github/workflows/`
- Docs: `README.md`, `CONTRIBUTING.md`, `.github/RELEASE_WORKFLOWS.md`
- Config: `pyproject.toml`, `.commitlintrc.json`, `.github/dependabot.yml`
- Config: `release-please-config.json`, `.release-please-manifest.json`, `.commitlintrc.json`, `.github/dependabot.yml`
- Scripts: `scripts/commit-msg`, `scripts/setup-dev.sh`
10 changes: 4 additions & 6 deletions .github/RELEASE_WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ This project has three release workflows:
**Triggers:** Automatically on every push to `main` branch

**What it does:**
- Uses semantic-release to analyze commit messages
- Automatically determines version number based on commit types
- Creates and publishes release immediately
- Updates manifest.json version
- Generates changelog from commits
- Uses [Release Please](https://github.com/googleapis/release-please) to analyze commit messages
- Opens or updates a standing "chore(main): release X.Y.Z" pull request containing the version bump (`custom_components/minibrew/manifest.json`) and a `CHANGELOG.md` entry
- Only tags the release and publishes the GitHub release once that pull request is merged to `main`

**Version bump rules:**
- Minor: `feat`
- Patch: `fix`, `perf`, `ci`, `build`, `chore`

**Usage:** Just merge your PR to main with proper conventional commit messages.
**Usage:** Merge your PR to main with proper conventional commit messages, then review and merge the release PR that Release Please opens/updates to actually cut the release.

---

Expand Down
22 changes: 0 additions & 22 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,3 @@ updates:
- "github-actions"
reviewers:
- "stuartp44"

# Python dependencies
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
commit-message:
prefix: "build"
prefix-development: "build"
include: "scope"
labels:
- "dependencies"
- "python"
reviewers:
- "stuartp44"
ignore:
# Ignore patch updates for stable dependencies
- dependency-name: "python-semantic-release"
update-types: ["version-update:semver-patch"]
50 changes: 6 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,52 +89,14 @@ jobs:
- name: Validate current commit
run: echo "${{ github.event.head_commit.message }}" | commitlint

release:
release-please:
runs-on: ubuntu-latest
needs: [validate-hacs, validate-hassfest, validate-manifest, validate-commits]

steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Release Please
uses: googleapis/release-please-action@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-semantic-release "GitPython<3.1.60"

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
semantic-release version
semantic-release publish

- name: Update manifest.json version
if: success()
run: |
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
python -c "
import json
with open('custom_components/minibrew/manifest.json', 'r+') as f:
data = json.load(f)
data['version'] = '${VERSION}'
f.seek(0)
json.dump(data, f, indent=2)
f.truncate()
"
git add custom_components/minibrew/manifest.json
git commit -m "chore: update manifest version to ${VERSION}" || echo "No changes to commit"
git push origin main || echo "No changes to push"
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
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.11.0"
}
44 changes: 0 additions & 44 deletions pyproject.toml

This file was deleted.

29 changes: 29 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "simple",
"changelog-path": "CHANGELOG.md",
"extra-files": [
{
"type": "json",
"path": "custom_components/minibrew/manifest.json",
"jsonpath": "$.version"
}
],
"changelog-sections": [
{ "type": "feat", "section": "Added" },
{ "type": "fix", "section": "Fixed" },
{ "type": "perf", "section": "Changed" },
{ "type": "refactor", "section": "Changed" },
{ "type": "docs", "section": "Changed", "hidden": false },
{ "type": "chore", "section": "Changed", "hidden": true },
{ "type": "style", "section": "Changed", "hidden": true },
{ "type": "test", "section": "Changed", "hidden": true },
{ "type": "build", "section": "Changed", "hidden": true },
{ "type": "ci", "section": "Changed", "hidden": true },
{ "type": "revert", "section": "Changed" }
]
}
}
}
14 changes: 0 additions & 14 deletions scripts/setup-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@ else
echo "Warning: .git directory not found, skipping Git hooks"
fi

# Install Python dependencies (optional)
echo ""
echo "Python development dependencies..."
read -p "Do you want to install Python semantic-release tools? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
if command -v pip &> /dev/null; then
pip install python-semantic-release
echo "Python semantic-release installed"
else
echo "Warning: pip not found, skipping Python dependencies"
fi
fi

# Install Node.js dependencies for commitlint (optional)
echo ""
echo "Node.js development dependencies..."
Expand Down
Loading