Skip to content

Bump Version

Bump Version #5

Workflow file for this run

name: Bump Version
on:
pull_request:
types:
- closed
branches:
- main
workflow_dispatch:
workflow_call:
jobs:
if_manual:
name: Check for workflow_dispatch
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Halt on workflow_dispatch trigger
run: |
echo The workflow was manually triggered, so no version bump will be pushed.
build:
uses: ./.github/workflows/build.yml
bump-version:
name: 'Bump version on main branch'
needs: [build]
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Git repository
uses: 'actions/checkout@v3'
with:
ref: ${{ github.ref }}
- name: Read package.json
run: cat ./package.json
- name: Automated Version Bump
id: version-bump
uses: 'phips28/gh-action-bump-version@master'
with:
tag-prefix: 'v'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Read package.json
run: cat ./package.json
- name: Output Step
env:
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
run: echo "new tag $NEW_TAG"
# Workflow:
#
# 1. Based on the commit messages, increment the version from the latest release.
# * If the string "BREAKING CHANGE", "major" or the Attention pattern
# `refactor!: drop support for Node 6` is found anywhere in any of the commit messages or
# descriptions the major version will be incremented.
# * If a commit message begins with the string "feat" or includes "minor" then the minor version
# will be increased. This works for most common commit metadata for feature additions: "feat:
# new API" and "feature: new API".
# * If a commit message contains the word "pre-alpha" or "pre-beta" or "pre-rc" then the
# pre-release version will be increased (for example specifying pre-alpha: 1.6.0-alpha.1 ->
# 1.6.0-alpha.2 or, specifying pre-beta: 1.6.0-alpha.1 -> 1.6.0-beta.0)
# * All other changes will increment the patch version.
#
# 2. Push the bumped npm version in package.json back into the repo.
#
# 3. Push a tag for the new version back into the repo.