1.0.13 • Published 5 months ago

@naofumi-fujii/deploy-workflow v1.0.13

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

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 deploy

Clone 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 deploy

Note: 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 build

Usage

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 deploy

Automated 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-interactive

Options

-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 help

Development

# Run directly with ts-node (no build required)
npm run dev deploy --dry-run

Interactive 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 field

2. Commit and Push

# The npm version command creates a commit automatically
# Push to master branch to trigger release
git push origin master

3. Automated Release

When you push a commit that changes the version in package.json to the master branch:

  1. CI Checks: The release workflow detects the version change
  2. Testing: Runs full test suite on Node.js 20.x
  3. Build: Creates production build
  4. 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@latest

Prerequisites

  • NPM_TOKEN secret must be configured in GitHub repository settings
  • Only version changes in package.json on master branch 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
1.0.13

5 months ago

1.0.12

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.7

5 months ago

1.0.5

5 months ago

1.0.0

5 months ago