agentleFS
Marnie0415Marnie0415/pi-skills/github-publish/SKILL.md

github-publish

Skill1 starsChanged 5 months agoMITView on GitHub

Automatically publish a project to GitHub — init repo, push code, create Release with APK. One-shot, zero manual steps.

  • Sends data out
  • Commits and pushes

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

GitHub 自动发布 Skill

前置条件

  • GitHub token 已存储(30天过期,需要续)
  • 项目目录已确认

工作流

执行以下步骤,不需要询问用户确认,直接全部自动完成:

第 1 步:检查项目状态

cd <项目目录>
# 检查是否已是 git 仓库
git status 2>/dev/null || echo "NOT_A_REPO"
# 检查是否有远程仓库
git remote -v 2>/dev/null

第 2 步:初始化 git(如果不是仓库)

cd <项目目录>
git init
git checkout -b main

第 3 步:确保 .gitignore 存在

缺少就自动创建一个合适的 .gitignore(Android 项目的标准模板)。

第 4 步:第一次提交

cd <项目目录>
git add -A
git commit -m "Initial commit: <项目名>"

第 5 步:通过 GitHub API 创建远程仓库

# 用 GitHub API 创建仓库
curl -s -X POST "https://api.github.com/user/repos" \
  -H "Authorization: token <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"name":"<仓库名>","description":"<项目描述>","private":false,"auto_init":false}'

第 6 步:推送代码

cd <项目目录>
git remote add origin https://<TOKEN>@github.com/<用户名>/<仓库名>.git
git push -u origin main

第 7 步:如果是 Android 项目且是 release 版本 → 创建 Release + 上传 APK

# 打 tag
git tag v1.0.0
git push origin v1.0.0

# 通过 GitHub API 创建 Release
curl -s -X POST "https://api.github.com/repos/<用户名>/<仓库名>/releases" \
  -H "Authorization: token <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"tag_name":"v1.0.0","name":"v1.0.0","body":"首次发布","draft":false,"prerelease":false}'

# 上传 APK(需要上一步返回的 upload_url)
# 如果有已编译好的 APK 文件,自动上传到 Release

第 8 步:写 README(如果项目还没有)

自动生成包含以下内容的 README.md:

  • 项目名称和一句话介绍
  • 功能特性清单
  • 技术栈
  • 快速开始步骤
  • 许可证说明

第 9 步:添加开源许可证

如果项目没有 LICENSE 文件,自动创建 MIT License。

变量替换说明

执行时自动填入以下信息:

  • <项目目录> — 用户当前项目路径
  • <项目名> — 从目录名或用户指定
  • <仓库名> — 通常与项目名相同
  • <用户描述> — 用户在 GitHub 上的用户名(从 API 获取)
  • <TOKEN> — 从 memory 读取的 GitHub token
  • <项目描述> — 从项目的 metadata.json 或 README 提取

每个步骤完成后自动继续,无需用户干预。

完成后汇总输出:仓库 URL、Release 下载链接。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.