feat: initial stamp implementation

- stamp add: create .stamp/*.md changeset files (interactive + --no-interactive)
- stamp status: show pending stamps and projected next versions (plain + --json)
- stamp version: consume stamps, bump semver, update CHANGELOGs, commit
- stamp publish: create git tags, GitHub/Gitea releases, upload artifacts
- stamp comment: post/update idempotent PR comments via GitHub/Gitea API
- Supports monorepos via stamp.toml [[projects]] blocks
- Changeset files support YAML (---) and TOML (+++) frontmatter
- Semver + pre-release support (alpha, beta, rc)
- Examples and workflow documentation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Thomas
2026-03-08 20:56:23 +01:00
commit 77462f5e8a
25 changed files with 2518 additions and 0 deletions

46
examples/stamp.toml Normal file
View File

@@ -0,0 +1,46 @@
# stamp.toml — annotated example configuration
# Global settings (all optional)
[config]
# The base branch used by `stamp comment` to detect what's changed in a PR.
base_branch = "main"
# Directory where stamp files (.md changesets) are stored.
# Default: .stamp
changeset_dir = ".stamp"
# --- Projects ---
# Define one [[projects]] block per versioned component.
# For single-project repos, define just one block with name = "" (or any name).
[[projects]]
name = "my-app"
path = "apps/my-app" # path relative to repo root
version = "1.2.3" # current version — updated by `stamp version`
changelog = "CHANGELOG.md" # relative to path (default: CHANGELOG.md)
[projects.publish]
# Create and push a git tag for this project on `stamp publish`.
# Tag format: <name>@v<version> e.g. my-app@v1.2.3
tags = true
# Create a GitHub/Gitea release with the changelog section as the release body.
releases = true
# Glob patterns (relative to repo root) for files to upload as release artifacts.
artifacts = [
"apps/my-app/dist/my-app-linux-amd64",
"apps/my-app/dist/my-app-darwin-arm64",
"apps/my-app/dist/my-app-windows-amd64.exe",
]
[[projects]]
name = "my-lib"
path = "libs/my-lib"
version = "0.1.0"
[projects.publish]
tags = true
releases = true
# No artifacts for a library.
artifacts = []