Skip to content

About

dsh-go 原生插件:把任意项目一键发布到 GitHub(建仓/推送/tag/Release/附件/SHA256 校验,通用版)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

local-publish-github · One-command GitHub releases

Built on the dsh-go native plugin framework · version v0.11.6 · MIT

🌐 English · 中文

A local plugin for the dsh-go mobile app: it adds "Publish GitHub / Save token" capsules above the composer, so you can publish any project to GitHub with one generic command.

Confirm version → preflight → secret scan → assets + SHA256 → push (fast-forward only) → tag (create only) → Release (Chinese-first notes) → upload → read-back verification.

About

confirm version + release notes
  → preflight (token / repo / tag / remote branch)
  → privacy & secret scan
  → collect assets + generate SHA256SUMS
  → commit → push (fast-forward only)
  → create tag (never moved)
  → create Release (Chinese-first body)
  → upload assets → verify count and size

Why

  • The two scariest part of releasing from a phone: pushing to the wrong repo and a tag being moved
  • AI assistants tend to "publish first, ask later" — so two hard gates are built in
  • Uploads fail halfway all the time — you need resume / overwrite re-upload

At a glance

Version Components Dependencies License
v0.11.6 2 capsules + 2 panels GitHub REST API, curl, git MIT

Features

Where Name What it does
Capsule Publish GitHub Inserts a generic release instruction into the composer (never auto-sends, never auto-publishes)
Capsule Save token Reads a GitHub token from the clipboard, verifies it, stores it at ~/.config/dsh-go/github-token (0600)
Panel GitHub token Show status / delete the local token
Panel Publish steps Current status + generic flow + copy instruction

Install

dsh plugin --profile web add /path/to/local-publish-github

# or unzip first
unzip local-publish-github-0.11.6.zip -d local-publish-github
dsh plugin --profile web add ./local-publish-github

After install it appears in Settings → Plugins as "GitHub 发布". Restart the core after editing the source.

Quick start

  1. Create a token: GitHub → Settings → Developer settings → Tokens (classic) → scope repo
  2. Save it: tap the "Save token" capsule (or write ~/.config/dsh-go/github-token, mode 600)
  3. Optional project config — .publish.json:
{
  "repo": "owner/name",
  "display_name": "my-project",
  "assets": ["dist/pkg-v{version}.zip"],
  "notes_file": "CHANGELOG.md"
}
  1. Confirm first: send the version + release notes to the owner and get explicit approval
  2. Publish:
bash bin/publish.sh --dir <project> --version 0.1.0 --notes-reviewed --confirmed

Usage examples

# dry run: no commit, no push, no upload
bash bin/publish.sh --dir ./myproj --version 0.2.0 --dry-run

# draft release
bash bin/publish.sh --dir ./myproj --version 0.2.0 --draft --confirmed

# assets + auto-generated English changelog appendix (Chinese body stays first)
bash bin/publish.sh --dir ./myproj --version 0.2.0 \
  --assets "dist/*.zip" --generate-notes --confirmed

# resume after a failed upload (release exists with no assets)
bash bin/publish.sh --dir ./myproj --version 0.2.0 --resume --confirmed

Parameters

Flag Meaning
--dir Project directory (required)
--version Version (required, set by a human; never auto-bumped)
--repo owner/name (or via .publish.json)
--display-name Project name used in the Release title
--assets Assets; supports {version} and globs, read line by line
--notes / --notes-file Release body (defaults to CHANGELOG)
--tag-prefix Tag prefix, default v
--create-repo / --public Create repo if missing (private by default)
--dry-run Preflight only

Release-notes gate: a real publish (not --dry-run) requires --notes-reviewed, meaning the notes text was shown to the user and approved. The script refuses to publish otherwise.

| --confirmed | User approved; actually publish | | --draft / --prerelease | Draft / prerelease | | --generate-notes | Append GitHub auto-generated English notes | | --resume / --overwrite-files | Resume / delete this release's assets then re-upload | | --allow-overwrite | Allow overwriting when remote has commits not present locally | | --json | Machine-readable output |

Safety guards

  • Token must be mode 600 and is passed via curl --config - (never in argv)
  • Auth failure / missing repo / existing tag / remote commits not present locally → refuse
  • Tags are created only, never moved; branches must be fast-forward
  • Scans for private keys / GitHub tokens before publishing
  • Verifies asset count and size after upload
  • Release body is Chinese-first; the auto-generated English part is an appendix only
  • Version numbers are always chosen by a human

⚠️ Security notice: installing any dsh-go plugin means running third-party code with your permissions. Only install from trusted sources, pin tags/commits, and verify SHA256 of downloaded packages.

Layout

local-publish-github/
├── package.json
├── cordis.patch.yml
├── lib/index.js
├── bin/publish.sh
├── docs/
├── README.md        # English
├── README_zh.md     # 中文
├── CHANGELOG.md
└── LICENSE

Docs

Doc Content
docs/通用发布步骤.md Full release flow (Chinese)
CHANGELOG.md Source of the "release notes"

Verify downloads

sha256sum -c local-publish-github-0.11.6.zip.sha256

Contributing

  1. Fork
  2. git checkout -b feature/your-idea
  3. Commit
  4. git push origin feature/your-idea
  5. Open a Pull Request

Keep the existing guards (tags never move, fast-forward only, token never in argv, assets always verified).

Tech stack

Layer Used
Plugin framework dsh-go native plugin (dshGo.v1, capsules + panels)
Runtime Node.js (ESM), lib/index.js
Publishing Bash + curl + git + Python 3
API GitHub REST API

Thanks

Contact

Versioning

Version numbers are set manually by the owner; neither the plugin nor the script bumps them.

License

MIT — see LICENSE.

Copyright (c) 2026 xiaotianya14 · built on the dsh-go native plugin framework

About

dsh-go 原生插件:把任意项目一键发布到 GitHub(建仓/推送/tag/Release/附件/SHA256 校验,通用版)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages