Skill: weapon3k/github-release-workflow (version 1.1.0)

--- name: github-release-workflow description: "Professional GitHub release workflow. Use when: (1) releasing a new version, (2) managing versions and tags, (3) following conventional commits, (4) updating README and docs, (5) setting up CI/CD for releases." metadata: { openclaw: { emoji: "🚀" }, } --- # GitHub Release Workflow Skill A standardized workflow for professional GitHub releases. **IMPORTANT: Always update README.md and documentation before releasing!** ## Prerequisites - Git installed - GitHub CLI (`gh`) authenticated - Git repository initialized ## Quick Commands ### Full Release Flow ```bash # 1. Ensure clean working tree git status # 2. Run tests and format pip install -e ".[dev]" pytest black lib/ tests/ # 3. Update version in pyproject.toml # Edit: version = "2.1.0" # 4. Update CHANGELOG.md # Add new section with today's date # 5. Update README.md (IMPORTANT!) # - Update version badge # - Update features list # - Update project structure if changed # - Update roadmap table # 6. Update other docs as needed # - docs/*.md # - API documentation # - Examples # 7. Stage and commit git add . git commit -m "release: v2.1.0 - Description" # 8. Create tag git tag -a v2.1.0 -m "Version 2.1.0" # 9. Push git push git push origin v2.1.0 ``` ### README Update Checklist When releasing a new version, always update README.md: | Item | Description | |------|-------------| | Version badge | Update `version-x.x.x-blue` | | Features list | Add new features, remove deprecated | | Project structure | Reflect new files/directories | | Installation | Update if deps changed | | Usage | Add new examples if needed | | Roadmap | Move current version to done, add next | | API docs | Update if API changed | ### Conventional Commits Format ``` <type>(<scope>): <description> Types: feat, fix, docs, style, refactor, test, chore, release ``` Examples: - `feat(memory): add SQLite support` - `fix(vitality): correct energy calculation` - `docs: update README` ### Version Format ``` MAJOR.MINOR.PATCH - MAJOR: Breaking changes - MINOR: New features (backward compatible) - PATCH: Bug fixes ``` ## Branch Strategy ``` main (stable) ↑ develop (integration) ↑ feature/* (new features) ``` ## GitHub Release (Optional) ```bash gh release create v2.1.0 \ --title "Version 2.1.0" \ --notes "Release notes" ``` ## See Also - Full specification: `github-release-workflow/SPEC.md` - Keep a Changelog: https://keepachangelog.com/ - Semantic Versioning: https://semver.org/ - Conventional Commits: https://www.conventionalcommits.org/

path: pyproject.toml
content: [build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "github-release-workflow"
version = "1.1.0"
description = "Professional GitHub release workflow specification"
readme = "README.md"
license = {text = "MIT"}
authors = [
    {name = "Steven", email = "[REDACTED_SECRET]"}
]
keywords = ["git", "github", "release", "workflow", "cicd", "conventional-commits"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: MIT License",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
]

dependencies = []

[project.scripts]
gh-release = "release:main"

[tool.setuptools.packages.find]
where = ["."]


path: README.md
content: # GitHub Release Workflow

<p align="center">
  <img src="https://img.shields.io/badge/version-1.0.0-blue" alt="Version">
  <img src="https://img.shields.io/badge/python-3.10+-green" alt="Python">
  <img src="https://img.shields.io/badge/license-MIT-orange" alt="License">
</p>

> A standardized workflow for professional GitHub releases.

## Overview

This project provides a complete specification and CLI tool for professional GitHub releases, following industry best practices:

- **Conventional Commits** — Clear commit message format
- **Semantic Versioning** — Standard version numbers
- **Keep a Changelog** — Structured changelog
- **GitHub Releases** — Tagged releases with notes

## Installation

```bash
git clone https://github.com/weapon3k/github-release-workflow.git
cd github-release-workflow
pip install -e .
```

## Quick Start

```bash
# Initialize git (first time)
gh-release init

# Create a release
gh-release release v1.0.0

# Check status
gh-release status

# View log
gh-release log -n 10
```

## Workflow

### 1. Prepare

```bash
# Ensure clean working tree
git status
pytest
black .
```

### 2. Update

- Update version in `pyproject.toml`
- Add entry to `CHANGELOG.md`

### 3. Release

```bash
git add .
git commit -m "release: v1.0.0"
git tag -a v1.0.0 -m "Version 1.0.0"
git push
git push origin v1.0.0
```

## Commit Format

```
<type>(<scope>): <description>

Types: feat, fix, docs, style, refactor, test, chore, release
```

## Version Format

```
MAJOR.MINOR.PATCH
```

- **MAJOR**: Breaking changes
- **MINOR**: New features (backward compatible)
- **PATCH**: Bug fixes

## Files

- `SPEC.md` — Full specification
- `SKILL.md` — OpenClaw skill definition
- `release.py` — CLI tool

## See Also

- [Conventional Commits](https://www.conventionalcommits.org/)
- [Semantic Versioning](https://semver.org/)
- [Keep a Changelog](https://keepachangelog.com/)

---

**License**: MIT


path: release.py
content: #!/usr/bin/env python3
"""GitHub Release Workflow CLI"""
import argparse
import subprocess
import sys
from pathlib import Path


def run(cmd: str, check: bool = True) -> None:
    """Run shell command"""
    print(f"→ {cmd}")
    result = subprocess.run(cmd, shell=True, check=check)
    if result.returncode != 0:
        sys.exit(result.returncode)


def cmd_init(args) -> None:
    """Initialize git repository"""
    if Path(".git").exists():
        print("Git repository already exists")
        return
    
    run("git init")
    run('git config user.name "Steven"')
    run('git config user.email "[REDACTED_SECRET]"')


def cmd_release(args) -> None:
    """Create a new release"""
    version = args.version
    
    print(f"Creating release {version}...")
    
    # Stage
    run("git add .")
    
    # Commit
    run(f'git commit -m "release: {version}"')
    
    # Tag
    run(f'git tag -a {version} -m "Version {version}"')
    
    # Push
    run("git push")
    run(f"git push origin {version}")
    
    print(f"✅ Release {version} complete!")


def cmd_status(args) -> None:
    """Show git status"""
    run("git status")


def cmd_log(args) -> None:
    """Show commit log"""
    run(f"git log --oneline -n {args.count}")


def main():
    parser = argparse.ArgumentParser(description="GitHub Release Workflow")
    subparsers = parser.add_subparsers(dest="command", help="Commands")
    
    # init
    subparsers.add_parser("init", help="Initialize git repository")
    
    # release
    rel_parser = subparsers.add_parser("release", help="Create release")
    rel_parser.add_argument("version", help="Version (e.g., v1.0.0)")
    
    # status
    subparsers.add_parser("status", help="Show git status")
    
    # log
    log_parser = subparsers.add_parser("log", help="Show commit log")
    log_parser.add_argument("-n", "--count", type=int, default=10)
    
    args = parser.parse_args()
    
    if args.command == "init":
        cmd_init(args)
    elif args.command == "release":
        cmd_release(args)
    elif args.command == "status":
        cmd_status(args)
    elif args.command == "log":
        cmd_log(args)
    else:
        parser.print_help()


if __name__ == "__main__":
    main()


path: SPEC.md
content: # GitHub Release Workflow Specification

> A standardized workflow for professional GitHub releases.

## Overview

This specification defines a professional release workflow for Python projects, inspired by industry best practices.

## Prerequisites

- Git installed
- GitHub CLI (`gh`) authenticated
- Python 3.10+
- Git repository initialized

## Release Workflow

### 1. Pre-Release Checklist

```bash
# Ensure clean working tree
git status

# Update dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black lib/ tests/

# Type checking (optional)
mypy lib/
```

### 2. Update Version

Update version in:
- `pyproject.toml` → `version`
- `CHANGELOG.md` → Add new version header

```bash
# Example: bump to 2.1.0
# Edit pyproject.toml: version = "2.1.0"
```

### 3. Update Changelog

Add new section in `CHANGELOG.md`:

```markdown
## [2.1.0] - YYYY-MM-DD

### Added
- New feature 1
- New feature 2

### Changed
- Improvement 1

### Fixed
- Bug fix 1

### Removed
- Deprecated feature 1
```

### 4. Stage Changes

```bash
git add .
git status
```

### 5. Commit

Follow [Conventional Commits](https://www.conventionalcommits.org/):

```bash
git commit -m "release: v2.1.0 - Added new features and improvements"
```

### 6. Create Tag

```bash
git tag -a v2.1.0 -m "Version 2.1.0: Release description"
```

### 7. Push

```bash
git push
git push origin v2.1.0
```

### 8. Create GitHub Release (Optional)

```bash
gh release create v2.1.0 \
  --title "Version 2.1.0" \
  --notes "Release notes from CHANGELOG.md"
```

## Branch Strategy

```
main (stable)
  ↑
develop (integration)
  ↑
feature/* (new features)
  ↑
hotfix/* (urgent fixes)
```

### Branch Types

| Branch | Purpose | Base | Merge To |
|--------|---------|------|----------|
| `main` | Stable releases | - | - |
| `develop` | Integration | main | main |
| `feature/*` | New features | develop | develop |
| `hotfix/*` | Urgent fixes | main | main, develop |
| `release/*` | Release prep | develop | main, develop |

## Versioning

Follow [Semantic Versioning](https://semver.org/):

```
MAJOR.MINOR.PATCH
  │    │    │
  │    │    └── Bug fixes
  │    └─────── New features (backward compatible)
  └─────────── Breaking changes
```

### Version Format

- **Release**: `v2.1.0` (annotated tag)
- **Pre-release**: `v2.1.0-alpha.1`, `v2.1.0-beta.1`
- **Build**: `v2.1.0+build.123`

## Commit Message Format

### Conventional Commits

```
<type>(<scope>): <description>

[optional body]

[optional footer(s)]
```

### Types

| Type | Description |
|------|-------------|
| `feat` | New feature |
| `fix` | Bug fix |
| `docs` | Documentation |
| `style` | Formatting |
| `refactor` | Code restructuring |
| `test` | Tests |
| `chore` | Maintenance |
| `release` | Version release |

### Examples

```bash
git commit -m "feat(memory): add SQLite storage support"
git commit -m "fix(vitality): correct energy decay calculation"
git commit -m "docs: update README with examples"
git commit -m "release: v2.1.0"
```

## CI/CD Integration (Optional)

### GitHub Actions Example

```yaml
# .github/workflows/release.yml
name: Release

on:
  push:
    tags:
      - 'v*'

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.10'
      - run: pip install -e ".[dev]"
      - run: pytest
      - run: pip install build
      - run: python -m build
      - uses: softprops/action-gh-release@v1
        with:
          files: dist/*
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

## Quick Reference

```bash
# Full release flow
git checkout develop
git pull origin develop
# Make changes...
git add .
git commit -m "feat: new feature"
git checkout main
git merge develop
git tag -a v2.1.0 -m "Version 2.1.0"
git push origin main --follow-tags

# Hotfix flow
git checkout main
git checkout -b hotfix/fix-description
# Fix...
git commit -m "fix: description"
git checkout main
git merge hotfix/fix-description
git tag -a v2.1.1 -m "Version 2.1.1"
git push origin main --follow-tags
git branch -d hotfix/fix-description
```

## Related Standards

- [Conventional Commits](https://www.conventionalcommits.org/)
- [Semantic Versioning](https://semver.org/)
- [Keep a Changelog](https://keepachangelog.com/)
- [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow)

---

_Last updated: 2026-02-22_


path: _meta.json
content: ownerId: kn71685jv7z3r8kfqpg450k4dd81kkd8
slug: github-release-workflow
version: 1.0.0
publishedAt: 1771693376110

Security scan verdicts — ClawScan: suspicious | static analysis:  | VirusTotal: suspicious | SkillSpector: suspicious (HIGH)