Loading...
Loading...
Use when releasing new versions for Debian projects with optional linglong.yaml support, updating debian/changelog, incrementing patch versions automatically, and creating git commits
npx skill4agent add re2zero/deepin-skills create-release-tagsdebian/changeloglinglong.yamldigraph when_to_use {
"Need to release version?" [shape=diamond];
"Debian project?" [shape=diamond];
"Use this skill" [shape=box];
"Wrong tool" [shape=box];
"Need to release version?" -> "Debian project?" [label="yes"];
"Debian project?" -> "Use this skill" [label="yes"];
"Debian project?" -> "Wrong tool" [label="no"];
}| Operation | Command | Behavior |
|---|---|---|
| Release specific version | | Updates to specified version |
| Auto-increment patch | | Increments patch (1.2.2 → 1.2.3) |
| Prepare test version | | Updates for testing phase |
# Check required files
if [ ! -f debian/changelog ]; then
echo "Error: Not a Debian project (debian/changelog not found)"
exit 1
fi
# Check for linglong.yaml files
LINGLONG_FILES=$(find . -name "linglong.yaml" -type f)
HAS_LINGLONG=1
if [ -z "$LINGLONG_FILES" ]; then
HAS_LINGLONG=0
fiTARGET_VERSION="$1" # e.g., 6.5.47# Extract current version from changelog
CURRENT_VERSION=$(head -1 debian/changelog | sed -n 's/.*(\(.*\)).*/\1/p')
# Extract and increment patch version (only increments patch: X.Y.Z → X.Y.Z+1)
MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1)
MINOR=$(echo $CURRENT_VERSION | cut -d. -f2)
PATCH=$(echo $CURRENT_VERSION | cut -d. -f3)
TARGET_VERSION="${MAJOR}.${MINOR}.$((PATCH + 1))"# Extract date from first author line in changelog
# Format: "Mon, 05 Jan 2026 15:29:58 +0800"
# This finds the line starting with " -- " and extracts the date part
CURRENT_DATE=$(grep -m1 "^ -- " debian/changelog | sed 's/.* //')
# Get commit titles since that date (note: two spaces before *)
if [ -n "$CURRENT_DATE" ]; then
CHANGES=$(git log --since="${CURRENT_DATE}" --pretty=format:" * %s")
else
# Fallback: get recent commits if date extraction fails
CHANGES=$(git log --pretty=format:" * %s" -10)
fi
# If no changes, use generic message
if [ -z "$CHANGES" ]; then
CHANGES=" * chore: bump version to ${TARGET_VERSION}"
fiAUTHOR_NAME=$(git config user.name)
AUTHOR_EMAIL=$(git config user.email)
if [ -z "$AUTHOR_EMAIL" ]; then
echo "Error: Git user.email not configured"
echo "Please run: git config user.email 'your@email.com'"
exit 1
fi
DATE_R=$(date -R)PACKAGE_NAME=$(head -1 debian/changelog | sed -n 's/\([^ ]*\) .*/\1/p')${PACKAGE_NAME} (${TARGET_VERSION}) unstable; urgency=medium
${CHANGES}
-- ${AUTHOR_NAME} <${AUTHOR_EMAIL}> ${DATE_R}
<existing entries follow>deepin-reader (6.5.47) unstable; urgency=medium
* fix: correct .tx/config
* chore: enhance service security
* feat: add new feature
-- Author Name <email@example.com> Mon, 05 Jan 2026 15:29:58 +0800
deepin-reader (6.5.46) unstable; urgency=medium
...# Read existing changelog
EXISTING=$(cat debian/changelog)
# Create new entry (note: two spaces before each * and author line)
NEW_ENTRY="${PACKAGE_NAME} (${TARGET_VERSION}) unstable; urgency=medium
${CHANGES}
-- ${AUTHOR_NAME} <${AUTHOR_EMAIL}> ${DATE_R}
"
# Write new content
echo "${NEW_ENTRY}${EXISTING}" > debian/changelog* * fix: something-- -- Author <email>X.Y.Z.NX.Y.Z.Nversion: 6.5.46.1version: 6.5.47.1if [ $HAS_LINGLONG -eq 1 ]; then
TARGET_VERSION_NO_PATCH=$(echo $TARGET_VERSION | cut -d. -f1-3)
find . -name "linglong.yaml" -type f -exec sed -i "s/version: [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/version: ${TARGET_VERSION_NO_PATCH}.1/g" {} \;
figit add debian/changelog
if [ $HAS_LINGLONG -eq 1 ]; then
git add $(find . -name "linglong.yaml" -type f)
fi
git commit -m "chore: update version to ${TARGET_VERSION}
- bump version to ${TARGET_VERSION}
Log : bump version to ${TARGET_VERSION}"chore: update version to <version>- bump version to <version>Log : bump version to <version>| Mistake | Why It's Wrong | Fix |
|---|---|---|
| Creating git tags | This skill only commits, does not tag | Use separate command for git tag creation |
| Using git tags for change summary | Git tags may not exist for all releases | Use changelog date instead |
| Updating all parts of linglong version | Only first three parts should change | Use |
| Missing git user.email | Author information required for changelog | Configure |
| Using "Release" in commit | Wrong commit message format | Use "chore: update version to X.Y.Z" |
| Forgetting to add linglong files | linglong.yaml changes need to be committed | Use |