Pipoca automates versioning in your package.json (or build.gradle.kts) based on your Git commit history. It's highly customizable and integrates seamlessly with GitHub Actions for streamlined CI/CD workflows.
Install Pipoca globally with npm:
npm install -g pipocaUsage: pipoca [options]
Commands:
history (h) Show tag history with calculated versions
update (u) Update project version based on semantic commit history
init (i) Create a default pipoca.config.json file
help Show help
version Show version
Options:
--version, -v Show version information
--help, -h Show help
Updates the version in the specified file based on semantic commit history. Supports:
package.jsonbuild.gradle.kts
pipoca update package.jsonShows the tag history with the calculated version for each tag.
pipoca historyCreates a default pipoca.config.json file in the current directory.
pipoca initEdit the pipoca.config.json file to define your custom tags and actions:
{
"keys": {
"patch": ["fix", "style", "docs"],
"minor": ["feature", "update"],
"major": ["new", "release"]
},
"commands": {
"before": [],
"after": [
"--update-version package.json $version$",
"git add package.json",
"git commit -m 'update version'"
]
},
"ignoreBeforeThisCommit": "a1b2c3d"
}- Tags
fix,style, anddocsincrement the patch version (0.0.x). - Tags
featureandupdateincrement the minor version (0.x.0). - Tags
newandreleaseincrement the major version (x.0.0).
Optional. Set a commit hash to start the version calculation from that commit (inclusive), ignoring all older commits. Useful for resetting your version baseline without rewriting history. Use git log --oneline to find commit hashes.
Pipoca is a perfect fit for CI/CD pipelines. Here's a sample GitHub Actions workflow for automated versioning:
name: Version Updater
on: [push]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Configure git
run: git config --global user.name 'kruceo' && git config --global user.email '${{secrets.OWNER_EMAIL}}'
- name: Run pipoca
run: |
npx -y https://github.com/Kruceo/Pipoca.git update package.json
- name: Push
run: |
git add package.json
git commit -m "[Automated] Update version"
git push origin HEAD- Updates your
package.jsonversion based on commit tags. - Pushes the updated
package.jsonback to the repository.
- Config Examples — Examples using
$version$placeholder and CI/CD workflows - Versioning and Release — Guide combining Pipoca with GitHub Actions and release automation
- Android Project —
build.gradle.ktssupport withversionCodeandversionName - Commit Conventions — How Pipoca parses commit messages and calculates versions
- Docker Workflow — Build and push Docker images tagged with the calculated version
- Monorepo Setup — Multiple package updates,
before/aftercommands, monorepo CI/CD
Streamline your versioning with Pipoca and let it handle the complexity for you!