-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add Homebrew CI/CD workflow and formula #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add Homebrew CI/CD workflow and formula #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Homebrew distribution support for the lic-cli tool by introducing a Homebrew formula and an automated CI/CD workflow that updates the formula on each release. The changes also include a version bump to 0.1.2 and code formatting improvements.
Key changes:
- New GitHub Actions workflow that automatically updates the Homebrew formula when a release is published
- Homebrew formula file that defines how to install lic-cli via Homebrew with Python 3.12 and uv dependencies
- Version bump from 0.1.1 to 0.1.2 and code formatting improvements in the CLI
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/release-homebrew.yml |
Adds automated workflow to update Homebrew formula on release events |
Formula/lic.rb |
Defines the Homebrew formula for installing lic-cli with dependencies and installation instructions |
pyproject.toml |
Bumps version to 0.1.2 |
uv.lock |
Updates package name to lic-cli and version to 0.1.1 |
src/lic_cli/cli.py |
Code formatting improvements (multi-line function arguments and dictionary formatting) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| desc "Minimal interactive license generator" | ||
| version "0.1.2" | ||
| homepage "https://github.com/kushvinth/lic" | ||
| url "https://api.github.com/repos/SigireddyBalasai/lic/tarball/v0.1.2" |
Copilot
AI
Jan 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The homepage URL points to "kushvinth/lic" but the tarball URL points to "SigireddyBalasai/lic". These should reference the same repository to avoid confusion and ensure the formula downloads from the correct source.
| url "https://api.github.com/repos/SigireddyBalasai/lic/tarball/v0.1.2" | |
| url "https://github.com/kushvinth/lic/archive/refs/tags/v0.1.2.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The homepage URL points to "kushvinth/lic" but the tarball URL points to "SigireddyBalasai/lic". These should reference the same repository to avoid confusion and ensure the formula downloads from the correct source.
the url will be changed automatically
| desc "Minimal interactive license generator" | ||
| version "0.1.2" | ||
| homepage "https://github.com/kushvinth/lic" | ||
| url "https://api.github.com/repos/SigireddyBalasai/lic/tarball/v0.1.2" |
Copilot
AI
Jan 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded URL in the formula will be replaced by the workflow, but the initial value references a repository (SigireddyBalasai/lic) that doesn't match the homepage (kushvinth/lic). Ensure this initial URL value is correct or add a comment explaining it will be replaced by the CI/CD workflow.
| url "https://api.github.com/repos/SigireddyBalasai/lic/tarball/v0.1.2" | |
| url "https://api.github.com/repos/kushvinth/lic/tarball/v0.1.2" |
| sed -i \ | ||
| -e "s|^ url .*| url \"${{ steps.archive.outputs.url }}\"|" \ | ||
| -e "s|^ sha256 .*| sha256 \"${{ steps.archive.outputs.sha256 }}\"|" \ | ||
| -e "s|^ version .*| version \"${{ steps.version.outputs.version }}\"|" \ | ||
| "$FORMULA" |
Copilot
AI
Jan 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed command uses the -i flag without a backup suffix, which behaves differently on macOS (BSD sed) vs Linux (GNU sed). Since this workflow runs on ubuntu-latest, it's fine, but for clarity and to avoid confusion if the script is run elsewhere, consider being explicit about the environment or adding a comment noting this is GNU sed specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
| VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
|
|
Copilot
AI
Jan 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version extraction using grep and sed is fragile and could fail if the pyproject.toml format changes (e.g., using single quotes, extra spaces). Consider using a proper TOML parser like 'yq' or Python's tomllib/toml for more reliable version extraction.
| VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| VERSION=$(python - << 'PY' | |
| import pathlib | |
| import sys | |
| try: | |
| import tomllib # Python 3.11+ | |
| except ImportError: | |
| sys.exit("Python tomllib module is not available") | |
| data = tomllib.loads(pathlib.Path("pyproject.toml").read_text(encoding="utf-8")) | |
| version = None | |
| # Try common locations for version in pyproject.toml | |
| project = data.get("project") | |
| if isinstance(project, dict): | |
| version = project.get("version") | |
| if version is None: | |
| tool = data.get("tool") | |
| if isinstance(tool, dict): | |
| poetry = tool.get("poetry") | |
| if isinstance(poetry, dict): | |
| version = poetry.get("version") | |
| if not version: | |
| sys.exit("Could not find version in pyproject.toml") | |
| print(version) | |
| PY | |
| ) | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" |
| end | ||
|
|
||
| test do | ||
| system bin/"lic", "--help" |
Copilot
AI
Jan 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test only checks if the help command runs successfully but doesn't verify any output or actual functionality. Consider adding a more comprehensive test that validates the command produces expected output or performs a basic operation to ensure the installation is functional.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
add ci/cd workflow which trigger on each release