Skip to content

Latest commit

 

History

History
164 lines (121 loc) · 3.72 KB

File metadata and controls

164 lines (121 loc) · 3.72 KB

Publishing Guide

This document explains how to publish updates for both Node.js and Ruby versions.

Publishing Node.js Version to npm

cd nodejs

# 1. Update version in package.json
npm version patch  # or minor, or major

# 2. Publish to npm
npm publish

# 3. Update Homebrew formula (if needed)
cd ..
./scripts/get-homebrew-sha.sh
# Update Formula/slack-profile-nodejs.rb with new SHA256

Publishing Ruby Version to RubyGems

cd ruby

# 1. Update version in lib/slack_profile/version.rb
# Edit the VERSION constant

# 2. Build the gem
gem build slack_profile.gemspec

# 3. Push to RubyGems
gem push slack_profile-1.0.0.gem

# 4. Tag and push to GitHub
cd ..
git add ruby/lib/slack_profile/version.rb
git commit -m "Bump version to 1.0.0"
git tag v1.0.0
git push && git push --tags

Publishing to Homebrew

First Time Setup

  1. Create a Homebrew tap repository on GitHub:

    • Go to: https://github.com/new
    • Repository name: homebrew-slack-profile
    • Description: "Homebrew tap for slack-profile CLI"
    • Make it public
    • Create repository
  2. Initialize the tap with your formula:

    # Clone your new tap repository
    git clone https://github.com/jaspermayone/homebrew-tap.git
    cd homebrew-slack-profile
    
    # Create Formula directory
    mkdir Formula
    
    # Copy the formula
    cp /path/to/slack-profile-cli/Formula/slack-profile.rb Formula/
    
    # Commit and push
    git add .
    git commit -m "Add slack-profile formula"
    git push
    ```i
    
  3. Users can now install with:

    brew install jaspermayone/tap/slack-profile

Updating the Formula (After Each Release)

When you publish a new version to npm:

  1. Get the new SHA256:

    cd /path/to/slack-profile-cli
    ./scripts/get-homebrew-sha.sh
  2. Update the formula in your tap repository:

    cd /path/to/homebrew-slack-profile
    
    # Edit Formula/slack-profile.rb
    # Update the version number in the URL
    # Update the sha256 value
    
    git add Formula/slack-profile.rb
    git commit -m "Update slack-profile to v1.x.x"
    git push
  3. Users will automatically get the update:

    brew update
    brew upgrade slack-profile

Complete Release Workflow

Here's the complete workflow when releasing a new version:

# 1. In slack-profile-cli repo
cd /path/to/slack-profile-cli

# 2. Update version and publish to npm
npm version patch
npm publish
git push && git push --tags

# 3. Get SHA256 for Homebrew
./scripts/get-homebrew-sha.sh

# 4. Update Homebrew formula
cd /path/to/homebrew-slack-profile
# Edit Formula/slack-profile.rb with new version and SHA256
git add Formula/slack-profile.rb
git commit -m "Update slack-profile to $(node -p 'require("../slack-profile-cli/package.json").version')"
git push

# 5. Create GitHub release (optional but recommended)
# Go to https://github.com/jaspermayone/slack-profile-cli/releases/new
# Tag: v1.x.x
# Title: Release v1.x.x
# Describe changes

Current Status

Testing

Before publishing, test the formula locally:

# Install from local formula
brew install --build-from-source ./Formula/slack-profile.rb

# Test it works
slack-profile --help
slack-profile --version

# Uninstall
brew uninstall slack-profile

Resources