diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..6fd3be5 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,73 @@ +name: Update Documentation + +on: + push: + branches: + - main + paths: + - 'Casks/**' + - 'Formula/**' + - '.github/workflows/docs.yml' + - 'scripts/generate-docs.sh' + workflow_dispatch: + +permissions: + contents: write + pages: write + id-token: write + +jobs: + update-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate documentation + run: | + chmod +x scripts/generate-docs.sh + ./scripts/generate-docs.sh + + - name: Check for changes + id: check-changes + run: | + if git diff --quiet docs/index.html; then + echo "changed=false" >> $GITHUB_OUTPUT + else + echo "changed=true" >> $GITHUB_OUTPUT + fi + + - name: Commit and push changes + if: steps.check-changes.outputs.changed == 'true' + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add docs/ + git commit -m "docs: auto-update documentation from casks" + git push + + deploy-pages: + needs: update-docs + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: main + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 7603454..f06c215 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,47 @@ -# Lukaszraczylo Brew-taps +# Homebrew Tap -## How do I install these formulae? +Custom Homebrew tap for macOS and Linux tools by Lukasz Raczylo. -`brew install lukaszraczylo/homebrew-taps/` +## Available Casks -Or `brew tap lukaszraczylo/homebrew-taps` and then `brew install `. +| Cask | Description | +|------|-------------| +| [kportal](https://github.com/lukaszraczylo/kportal) | Modern Kubernetes port-forward manager with interactive TUI | +| [lolcathost](https://github.com/lukaszraczylo/lolcathost) | Dynamic hosts file manager with interactive terminal UI | +| [semver-generator](https://github.com/lukaszraczylo/semver-generator) | Automatic semantic version generator based on git commit messages | -Or, in a `brew bundle` `Brewfile`: +## Installation + +### Add the tap + +```bash +brew tap lukaszraczylo/taps +``` + +### Install a cask + +```bash +brew install --cask lukaszraczylo/taps/ +``` + +Or install directly: + +```bash +brew install --cask lukaszraczylo/taps/kportal +``` + +### Using Brewfile + +Add to your Brewfile: ```ruby -tap "lukaszraczylo/homebrew-taps" -brew "" +tap "lukaszraczylo/taps" +cask "kportal" +cask "lolcathost" +cask "semver-generator" ``` ## Documentation -`brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh). +- [Full Documentation](https://lukaszraczylo.github.io/homebrew-taps/) +- [Homebrew Documentation](https://docs.brew.sh) diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..24a2743 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,276 @@ + + + + + + Homebrew Tap - lukaszraczylo + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+
+
+ +
+

+ Homebrew
Tap +

+

+ Developer tools for macOS and Linux. Install powerful CLI utilities with a single command. +

+ +
+
+
+ + +
+
+
+

Available Casks

+

Install any of these tools with Homebrew

+
+
+ + + +
+
+
+ +
+
+

kportal

+ v0.2.46 +
+
+

Modern Kubernetes port-forward manager with interactive TUI

+
+ Kubernetes + TUI +
+ +
brew install --cask lukaszraczylo/taps/kportal
+
+ + +
+
+
+ + +
+
+
+

Installation

+

Get started in seconds

+
+
+
+

+ + Add the Tap +

+
brew tap lukaszraczylo/taps
+
+
+

+ + Install a Cask +

+
brew install --cask lukaszraczylo/taps/<cask-name>
+

Or install directly without tapping first:

+
brew install --cask lukaszraczylo/taps/kportal
+
+
+

+ + Using Brewfile +

+

Add to your Brewfile:

+
tap "lukaszraczylo/taps"
+cask "kportal"
+cask "lolcathost"
+cask "semver-generator"
+
+
+
+
+ + +
+
+
+
+ + brew-taps +
+ +

MIT License

+
+
+
+ + + + diff --git a/scripts/generate-docs.sh b/scripts/generate-docs.sh new file mode 100755 index 0000000..7140752 --- /dev/null +++ b/scripts/generate-docs.sh @@ -0,0 +1,178 @@ +#!/usr/bin/env bash +set -e + +# Generate documentation from Casks +# This script parses .rb files in Casks/ and updates docs/index.html + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(dirname "$SCRIPT_DIR")" +CASKS_DIR="$ROOT_DIR/Casks" +DOCS_DIR="$ROOT_DIR/docs" +INDEX_FILE="$DOCS_DIR/index.html" +TEMP_FILE="$DOCS_DIR/casks_temp.html" + +# Get metadata for a cask +get_icon() { + case "$1" in + kportal) echo "fa-ship" ;; + lolcathost) echo "fa-cat" ;; + semver-generator) echo "fa-code-branch" ;; + graphql-monitoring-proxy) echo "fa-chart-line" ;; + *) echo "fa-cube" ;; + esac +} + +get_colors() { + case "$1" in + kportal) echo "from-blue-500 to-purple-600" ;; + lolcathost) echo "from-pink-500 to-purple-600" ;; + semver-generator) echo "from-emerald-500 to-teal-600" ;; + graphql-monitoring-proxy) echo "from-rose-500 to-orange-600" ;; + *) echo "from-gray-500 to-gray-600" ;; + esac +} + +get_tag1() { + case "$1" in + kportal) echo "Kubernetes" ;; + lolcathost) echo "Hosts" ;; + semver-generator) echo "Git" ;; + graphql-monitoring-proxy) echo "GraphQL" ;; + *) echo "CLI" ;; + esac +} + +get_tag1_color() { + case "$1" in + kportal) echo "blue" ;; + lolcathost) echo "pink" ;; + semver-generator) echo "emerald" ;; + graphql-monitoring-proxy) echo "rose" ;; + *) echo "gray" ;; + esac +} + +get_tag2() { + case "$1" in + kportal) echo "TUI" ;; + lolcathost) echo "TUI" ;; + semver-generator) echo "Versioning" ;; + graphql-monitoring-proxy) echo "Monitoring" ;; + *) echo "" ;; + esac +} + +get_tag2_color() { + case "$1" in + kportal) echo "purple" ;; + lolcathost) echo "purple" ;; + semver-generator) echo "teal" ;; + graphql-monitoring-proxy) echo "orange" ;; + *) echo "gray" ;; + esac +} + +get_docs_url() { + case "$1" in + kportal) echo "https://kportal.raczylo.com" ;; + lolcathost) echo "https://lolcathost.raczylo.com" ;; + graphql-monitoring-proxy) echo "https://graphql-monitoring-proxy.raczylo.com" ;; + *) echo "" ;; + esac +} + +generate_cask_card() { + local name="$1" + local version="$2" + local desc="$3" + + local icon=$(get_icon "$name") + local colors=$(get_colors "$name") + local tag1=$(get_tag1 "$name") + local tag1_color=$(get_tag1_color "$name") + local tag2=$(get_tag2 "$name") + local tag2_color=$(get_tag2_color "$name") + local docs_url=$(get_docs_url "$name") + local github_url="https://github.com/lukaszraczylo/$name" + + local tags_html="${tag1}" + if [ -n "$tag2" ]; then + tags_html="$tags_html + ${tag2}" + fi + + local buttons_html="" + if [ -n "$docs_url" ]; then + buttons_html=" + Docs + + + GitHub + " + else + buttons_html=" + GitHub + " + fi + + cat << CARD_EOF + +
+
+
+ +
+
+

$name

+ v$version +
+
+

$desc

+
+ $tags_html +
+
+ $buttons_html +
+
brew install --cask lukaszraczylo/taps/$name
+
+ +CARD_EOF +} + +# Main +echo "Generating documentation from Casks..." + +if [ ! -f "$INDEX_FILE" ]; then + echo "Error: $INDEX_FILE not found" + exit 1 +fi + +# Generate casks HTML to temp file +echo "" > "$TEMP_FILE" + +for cask_file in "$CASKS_DIR"/*.rb; do + if [ -f "$cask_file" ]; then + name=$(basename "$cask_file" .rb) + version=$(grep -m1 'version "' "$cask_file" | sed 's/.*version "\([^"]*\)".*/\1/' 2>/dev/null || echo "latest") + desc=$(grep -m1 'desc "' "$cask_file" | sed 's/.*desc "\([^"]*\)".*/\1/' 2>/dev/null || echo "A Homebrew cask") + + generate_cask_card "$name" "$version" "$desc" >> "$TEMP_FILE" + fi +done + +# Now rebuild the index.html with the new casks content +# Read and process the file +{ + # Print everything up to and including CASKS_START + sed -n '1,//p' "$INDEX_FILE" + # Print the generated casks + cat "$TEMP_FILE" + # Print everything from CASKS_END onwards + sed -n '//,$p' "$INDEX_FILE" +} > "${INDEX_FILE}.new" + +mv "${INDEX_FILE}.new" "$INDEX_FILE" +rm -f "$TEMP_FILE" + +echo "Documentation updated successfully!"