1.0.13 • Published 5 months ago
@naofumi-fujii/deploy-workflow v1.0.13
Deploy Workflow CLI
A TypeScript CLI tool that automates deployment workflows for Git-based projects.
Installation
From npm Registry (Recommended)
# Install globally
npm install -g @naofumi-fujii/deploy-workflow@latest
# Use the command
deploy-workflow deployClone and Build (Alternative)
# Clone repository
git clone https://github.com/naofumi-fujii/deploy-workflow.git
cd deploy-workflow
# Install dependencies and build
npm install
npm run build
# Install globally for system-wide access
npm install -g .
# Now you can use deploy-workflow command anywhere
deploy-workflow deployNote: Installing directly from GitHub (
npm install -g git+https://github.com/...) won't work because the repository doesn't include pre-built files. You must clone and build locally first.
For Development
npm install
npm run buildUsage
Interactive Mode (Default)
# Start interactive workflow - select branches and confirm each step
npm run start deploy
# Or use the executable directly after building
./dist/cli.js deployAutomated Mode
# Run with predefined branches (non-interactive)
npm run start deploy --branch release/my-feature --target deploy/staging --no-interactive
# Dry run to see what would happen
npm run start deploy --dry-run
# Force non-interactive mode with defaults
npm run start deploy --no-interactiveOptions
-b, --branch <branch>    # Source branch to merge
-t, --target <target>    # Target branch  
--dry-run               # Show what would be done without executing
--no-interactive        # Run in non-interactive mode
--help                  # Show helpDevelopment
# Run directly with ts-node (no build required)
npm run dev deploy --dry-runInteractive Features
Workflow Mode Selection
- Choose between Interactive (step-by-step with confirmations) or Automated mode
 - Visual workflow summary before execution
 
Branch Selection
- Dynamic branch listing from your git repository
 - Separate lists for local and remote branches
 - Smart defaults with override options
 
Safety Confirmations
- Confirm each dangerous operation (checkout, merge, push)
 - Clear descriptions of what each step will do
 - Option to cancel at any point
 
Progress Indicators
- Visual progress bars for long-running operations
 - Real-time feedback during git operations
 - Professional CLI experience
 
Release Process
This project uses automated releases triggered by version changes in package.json. Here's how to create a new release:
1. Update Version
# Bump patch version (1.0.0 -> 1.0.1)
npm version patch
# Bump minor version (1.0.0 -> 1.1.0)
npm version minor
# Bump major version (1.0.0 -> 2.0.0)
npm version major
# Or manually edit package.json version field2. Commit and Push
# The npm version command creates a commit automatically
# Push to master branch to trigger release
git push origin master3. Automated Release
When you push a commit that changes the version in package.json to the master branch:
- CI Checks: The release workflow detects the version change
 - Testing: Runs full test suite on Node.js 20.x
 - Build: Creates production build
 - Publish: Automatically publishes to npm registry
 
4. Verify Release
Check that the new version is available:
# Check npm registry
npm view @naofumi-fujii/deploy-workflow versions --json
# Install latest version
npm install -g @naofumi-fujii/deploy-workflow@latestPrerequisites
- NPM_TOKEN secret must be configured in GitHub repository settings
 - Only version changes in 
package.jsononmasterbranch trigger releases - All tests must pass for release to succeed
 
Development
# Install dependencies
npm install
# Run in development mode
npm run dev deploy --dry-run
# Build for production
npm run build
# Run built version
npm run start deploy