返回 Skill 列表
extension
分类: 开发与工程无需 API Key

publish-release

在GitHub Packages上发布一个新的版本。当准备好发布时使用,需在测试通过并更新版本后。创建git标签并推送以触发GitHub Actions。

person作者: jakexiaohubgithub

publish-release

Publishes a new release to GitHub Packages via GitHub Actions.

Canonical Source: This skill is maintained at stoicstudio/ClaudeSkills. Run /update-skill publish-release or see Updating This Skill below.

Prerequisites

Before running, ensure:

  1. All code changes are complete
  2. dotnet test passes
  3. VersionInfo.cs has been updated with new version number
  4. CHANGELOG.md has been updated with release notes
  5. PROJECT_NAME is determined for the current project

Steps

  1. Read current version info from src/_PROJECT_NAME_/VersionInfo.cs:

    • Extract Version (e.g., "1.3.0")
    • Extract VersionName (e.g., "Agent Adoption Guidance")
  2. Check git status to see what files have changed

  3. Stage all changes:

    git add -A
    
  4. Create commit with version in message (use HEREDOC for proper formatting):

    git commit -m "$(cat <<'EOF'
    v{Version}: {VersionName}
    
    {Brief summary of changes from CHANGELOG.md}
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-Authored-By: Claude <noreply@anthropic.com>
    EOF
    )"
    
  5. Create git tag:

    git tag v{Version}
    
  6. Push to origin (triggers GitHub Actions NuGet publish):

    git push origin master --tags
    
  7. Announce completion: "As Above, so Below" - the local changes now manifest in the remote repository.

Workflow Monitoring

After push, monitor the GitHub Actions workflow until completion:

  1. Determine check interval by querying the last successful workflow duration:

    gh run list --repo {owner}/{repo} --status success --limit 5 --json databaseId,updatedAt,createdAt
    
    • Calculate average duration from recent successful runs
    • Use duration / 3 as the check interval (minimum 30 seconds, maximum 2 minutes)
    • If no previous runs, default to 1 minute interval
  2. Get the triggered workflow run ID:

    gh run list --repo {owner}/{repo} --limit 1 --json databaseId,status,conclusion,headBranch
    
    • Verify the run is for the correct tag/branch (v{Version})
  3. Poll workflow status at the calculated interval:

    gh run view {run_id} --repo {owner}/{repo} --json status,conclusion
    
    • Continue polling while status is queued, in_progress, or waiting
    • Stop when status is completed
  4. Report final result:

    • If conclusion is success: Report success with package availability
    • If conclusion is failure: Report failure and provide link to logs:
      gh run view {run_id} --repo {owner}/{repo} --web
      

Post-Release

After workflow completes successfully:

  1. Package will be available at: https://github.com/{owner}/{repo}/packages
  2. Users can update with: dotnet tool update --global {package-name}

Updating This Skill

This skill is distributed from the canonical repository. To update your local copy:

Manual Update

# From your project root
curl -sL https://raw.githubusercontent.com/stoicstudio/ClaudeSkills/main/skills/publish-release/SKILL.md \
  -o .claude/skills/publish-release/SKILL.md

Check for Updates

Compare your local version with canonical:

# Get canonical version
curl -sL https://raw.githubusercontent.com/stoicstudio/ClaudeSkills/main/skills/publish-release/SKILL.md | head -5

# Check local version
head -5 .claude/skills/publish-release/SKILL.md

Bulk Update (All Projects)

Use the sync script from the canonical repo:

# Clone or update ClaudeSkills repo
cd /path/to/ClaudeSkills
git pull

# Run sync to update all configured projects
./sync.sh