Pipoca automates versioning in your package.json
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 kruceo/pipoca
pipoca
This updates the package.json
version if necessary and amends the change into your latest commit. For full control, you can customize Pipoca's configuration.
pipoca --watch
This monitors your repository for commits and automatically updates package.json
after each commit.
Generate a configuration file with:
pipoca --create-config
This creates a pipoca.config.json
file where you can 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'"
]
}
}
- Tags
fix
,style
, anddocs
increment the patch version (0.0.x
). - Tags
feature
andupdate
increment the minor version (0.x.0
). - Tags
new
andrelease
increment the major version (x.0.0
).
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:
versioning:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Configure Git
run: |
git config --global user.name 'Your Name'
git config --global user.email 'your-email@example.com'
- name: Run Pipoca
run: |
npx -y https://github.com/Kruceo/Pipoca.git
- name: Push Changes
run: git push origin HEAD
- Updates your
package.json
version based on commit tags. - Pushes the updated
package.json
back to the repository.
Discover more commands and features with:
pipoca --help
Streamline your versioning with Pipoca and let it handle the complexity for you!