Skip to content

blackfisk-tech/github-version-bumper

 
 

Repository files navigation

Github Version Bumper

License: MIT

Bump your applications' version after each push.

Usage

Create a yaml file in workflows folder.

mkdir -p .github/workflows && touch .github/workflows/version.yaml

And configure your settings

name: "Bump Version"

on:
  push:
    branches:
      - "master"
jobs:
  bump-version:
    name: "Bump Version on master"
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout source code"
        uses: "actions/checkout@v3"
      - name: "GitHub Version Bumper"
        uses: "blackfisk-tech/github-version-bumper@master"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITHUB_NAME: "Your Name"
          GITHUB_EMAIL: "[email protected]"
          VERSION_FILE_NAME: "your_version_file.json"
          VERSION_FILE_PATH: "/your_version_file.json"

Customize with commit messages

Feature Commit Includes Old Version New Version
Default (Patches) - 1.5.8 1.5.9
Minor Bumping [ci-bump minor] 1.5.8 1.6.0
Major Bumping [ci-bump major] 1.5.8 2.0.0
Pre-releasing [ci-bump pre="staging"] 1.5.8 1.5.8-staging
Exact Versioning [ci-bump version="1.6.3"] 1.5.8 1.6.3

Environment Variables

Environment Value Description Default
GITHUB_TOKEN Your authorized GitHub token undefined
GITHUB_USER Your preferred GitHub display name 'GitHub Version Bumper'
GITHUB_EMAIL Your GitHub account's email address to make commits '[email protected]'
VERSION_FILE_NAME The file where your version entry exists 'package.json'
VERSION_ENTRY Entry key of your 'version' 'version'
VERSION_FILE_PATH Path to the file where your version entry exists '/package.json'

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

TODO

  • Currently only supports json need to support yaml an toml files as well.

Contributors

License

MIT

About

Automatically bump your repository's version after each commit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 66.8%
  • JavaScript 20.3%
  • Dockerfile 9.0%
  • Shell 3.9%