๐Ÿš€ Gem Publication System Documentation

This document describes the comprehensive gem publication system for Jekyll Theme Zer0, including VS Code integration and automatic changelog generation.

๐Ÿ“ New Publication Script

gem-publish.sh - Comprehensive Publication Workflow

The new comprehensive script that handles the entire gem publication process:

./scripts/gem-publish.sh [patch|minor|major] [options]

Key Features:

Usage Examples:

# Patch release (bug fixes)
./scripts/gem-publish.sh patch

# Minor release (new features)
./scripts/gem-publish.sh minor

# Major release (breaking changes)
./scripts/gem-publish.sh major

# Preview what would happen (dry run)
./scripts/gem-publish.sh patch --dry-run

# Skip publishing (development testing)
./scripts/gem-publish.sh patch --skip-publish --no-github-release

# Non-interactive mode (CI/CD)
./scripts/gem-publish.sh patch --non-interactive

๐ŸŽ›๏ธ VS Code Integration

Launch Configurations (F5 Debug Menu)

New launch configurations in .vscode/launch.json:

  1. ๐Ÿš€ Gem Publisher: Patch Release - Full patch version workflow
  2. ๐Ÿš€ Gem Publisher: Minor Release - Full minor version workflow
  3. ๐Ÿš€ Gem Publisher: Major Release - Full major version workflow
  4. ๐Ÿ” Gem Publisher: Dry Run (Patch) - Preview changes without modifications
  5. โšก Gem Publisher: Quick Build & Test - Development workflow, skip publishing
  6. ๐Ÿ“ Gem Publisher: Changelog Preview - Preview changelog generation only

Task Runner (Ctrl+Shift+P โ†’ โ€œTasks: Run Taskโ€)

New tasks in .vscode/tasks.json:

Gem Management Tasks:

๐Ÿ“‹ Automatic Changelog Generation

Commit Categorization

The system automatically categorizes commits based on conventional commit prefixes:

Added (New Features)

feat: add user authentication system
feature(api): implement rate limiting

Fixed (Bug Fixes)

fix: resolve memory leak in parser
bugfix(ui): correct button alignment issue

Changed (Modifications)

chore: update dependencies
refactor: improve code organization
perf: optimize database queries
style: fix code formatting
docs: update API documentation
test: add integration tests
ci: update workflow configuration
build: improve build process

Security (Security Updates)

security: patch XSS vulnerability
sec: update authentication tokens

Deprecated & Removed

# Deprecated - any commit containing "deprecat"
# Removed
remove: delete legacy API endpoints
rm: clean up unused files

Generated Changelog Format

## [1.2.3] - 2025-01-27

### Added
- User authentication system
- API rate limiting functionality

### Changed
- Updated dependencies to latest versions
- Improved code organization and structure

### Fixed
- Resolved memory leak in parser component
- Corrected button alignment in mobile view

### Security
- Patched XSS vulnerability in form processing

๐Ÿšฆ Complete Workflow Process

1. Environment Validation

2. Changelog Generation

3. Version Management

4. Testing & Building

5. Publication

6. Repository Synchronization

๐Ÿ”ง Prerequisites & Setup

Required Tools

# Check if tools are available
which git ruby gem bundle jq gh

Authentication Setup

# RubyGems authentication
gem signin

# GitHub CLI authentication (for releases)
gh auth login

File Requirements

๐Ÿ› Troubleshooting

Common Issues

โ€œWorking directory is not cleanโ€

git status           # Check what's uncommitted
git add . && git commit -m "commit message"
# or
git stash           # Temporarily stash changes

โ€œNot authenticated with RubyGemsโ€

gem signin          # Sign in to RubyGems.org

โ€œVersion already existsโ€

The script prevents republishing existing versions - you need to bump the version number first.

โ€œTests failedโ€

Fix test failures before proceeding, or use --skip-tests for emergency releases (not recommended).

Debug Mode

bash -x ./scripts/gem-publish.sh patch --dry-run

๐Ÿ”’ Security Features

๐ŸŽฏ How to Use

For Development (Quick Testing)

  1. Use โšก Gem: Quick Build & Test task or launch config
  2. This generates changelog, bumps version, runs tests, builds gem
  3. But skips publishing to RubyGems

For Preview (See What Would Happen)

  1. Use ๐Ÿ” Gem: Dry Run Preview task or launch config
  2. Shows exactly what changes would be made
  3. Great for reviewing changelog generation

For Real Releases

  1. Ensure working directory is clean
  2. Use appropriate release type:
    • Patch (0.0.X): Bug fixes
    • Minor (0.X.0): New features, backward compatible
    • Major (X.0.0): Breaking changes
  3. Use launch config or run: ./scripts/gem-publish.sh [type]

Access Methods

Via VS Code Debug Panel (F5)

  1. Open VS Code
  2. Press F5 or go to Run & Debug panel
  3. Select desired gem publication configuration
  4. Click play button

Via VS Code Task Runner

  1. Press Ctrl+Shift+P (Cmd+Shift+P on Mac)
  2. Type โ€œTasks: Run Taskโ€
  3. Select desired gem task from the list

Via Terminal

cd /path/to/zer0-mistakes
./scripts/gem-publish.sh patch --dry-run

๐Ÿ“Š Integration Benefits


This system transforms gem publication from a manual, error-prone process into a reliable, automated workflow while maintaining full control and visibility.