Skip to main content

使用 Github API 自动化一些工作的命令行工具。

项目描述

知乎

构建状态 执照

使用 Github 的 API 进行自动化的命令行工具:

  • 使用资产创建发布
  • 上传/下载文件到 github
  • 去做

安装

pip install githubot

用法

使用资产创建发布

Releases management.

Usage: githubot release --token=TOKEN --repo=REPO
                        [--tag=TAG] [--title=TITLE] [--message=MESSAGE]
                        [ASSETS...]

Options:
    --token=TOKEN           Github access token.
    -r=REPO --repo=REPO     Repo full name like: owner/repo.
    --tag=TAG               Tag name for the release. If the tag does not
                            exist it will be created on default branch.
    --title=TITLE           Title for the release.
    --message=MESSAGE       Message for the release.
    -h --help               Show this message and exit.

例如:

使用. WqyJh/test_assets/

githubot release --token <github_token> --repo WqyJh/test assets/*

创建一个版本并指定tag,titlemessage为它。

githubot release \
--token <github_token> \
--repo WqyJh/test \
--tag test_tag \
--title "This is an test title" \
--message "This release contains xxx" \
assets/*

该选项仅支持常规文件--assets,不支持目录。您可以通过以下方式指定文件:

--assets file1 file2
--assets path/* # wildcard

使用 github repo 作为云存储

Files management.

Usage: githubot file upload --token=TOKEN --repo=REPO  [FILES...]
       githubot file download --token=TOKEN --repo=REPO  [FILES...]

Options:
    --token=TOKEN           Github access token.
    -r=REPO --repo=REPO     Repo full name like: owner/repo.
    -h --help               Show this message and exit.

上传文件

将文件上传到 github 存储库WqyJh/test

./run.py file upload \
--token <github_token> \
--repo WqyJh/test \
file1 file2 file*

请注意FILES参数与 相同ASSETS,仅支持常规文件。

下载文件

从 github repo 下载文件WqyJh/test

./run.py file download \
--token <github_token> \
--repo WqyJh/test \
file1 dir1 dir2/

注意这里的FILES参数不能包含通配符,但可以包含目录。

删除文件

从 github 存储库中删除文件。

./run.py file delete \
--token <github_token> \
--repo Wqyjh/test \
file1 dir1 dir2/

发展

  • 碰撞 0.3.0 (PYPI)
  • 自动更改日志 1.15.0 (NPM)

释放过程如下:

  1. 计算语义版本
    git checkout dev
    git pull origin dev
    bumping
    
  2. 从 dev 创建发布分支
    git checkout -b release-<version>
    
  3. 修改版本并提交
  4. 生成变更日志并提交
    auto-changelog --latest-version <version> --tag-prefix v
    
  5. 合并到主分支
  6. 标记版本到主分支

变更日志

此项目的所有显着更改都将记录在此文件中。日期以 UTC 显示。

由 生成auto-changelog

0.7.0

2020 年 7 月 12 日

  • 壮举:添加配置命令#16

v0.6.1

2019 年 8 月 21 日

v0.6.0

2019 年 8 月 21 日

  • 发布 0.6.0#10
  • 文档:更新 README.md#9
  • 壮举:添加文件删除#8
  • 壮举:添加目录下载#7
  • 文档:更新 README.md#4
  • 文档:更新 CHANGELOG.mde6c15a5
  • 将版本提升至 0.6.07156b94
  • 解决冲突c794221

v0.4.0

2019 年 8 月 20 日

  • 发布 0.4.0#2
  • 贮存#1
  • 壮举:通过资产上传添加发布创建28c5214
  • 壮举:用docopt替换click9a7acd9
  • 苦差事:添加设置配置2cc899f

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

githubot-0.7.0.tar.gz (6.0 kB 查看哈希

已上传 source

内置分布

githubot-0.7.0-py3-none-any.whl (7.6 kB 查看哈希

已上传 py3