Bruh
Bruh is a Ruby gem that automates the release process for Haskell packages to both Hackage and Homebrew. It streamlines the workflow of releasing Haskell packages by handling version updates, changelog management, Hackage publishing, and Homebrew formula updates.
Features
- Cabal Integration: Parse and update Cabal files with version bumps
- Changelog Management: Auto-update CHANGELOG.md with new version entries
- Hackage Publishing: Publish packages to Hackage with documentation
- Homebrew Formula Generation: Update Homebrew formulas with new versions and SHAs
- Bottle Building: Build and publish Homebrew bottles to GitHub
- Non-interactive Mode: Support for CI/CD pipelines and automated testing
Installation
Install the gem by executing:
gem install bruh
Usage
Command Line Interface
The primary interface is through the bruh
command:
# Interactive release process
bruh release
# Non-interactive release with specific version
bruh release --non-interactive --version 0.1.2
# Skip specific steps
bruh release --skip-hackage --skip-bottles
# Show version
bruh version
Non-interactive Release Script
For CI/CD pipelines, you can use the included release script:
# Basic usage
bin/release --version 0.1.2
# Skip specific steps
bin/release --version 0.1.2 --skip-hackage --skip-bottles
# Run in interactive mode
bin/release --interactive
Configuration
Bruh stores configuration in ~/.config/bruh/config.toml
. For non-interactive usage, you should set up your Hackage credentials:
# Setup credentials
bruh config setup
# Manually set credentials
bruh config set hackage_username "your-username"
bruh config set hackage_password "your-password"
bruh config set github_token "your-token"
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt.
Running Tests
# Run all tests
bundle exec rake test
# Run a specific test
bundle exec ruby -I lib:test test/test_cabal.rb -n test_name
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -am 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Create a new Pull Request
License
The gem is available as open source under the terms of the MIT License.