Bump Version #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bump Version | |
on: | |
workflow_dispatch: | |
inputs: | |
type: | |
description: 'Type of version (`major`, `minor`, `patch`)' | |
required: true | |
default: 'patch' | |
jobs: | |
bump: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
token: ${{secrets.PAT}} # use a personal acces token so that other actions can trigger | |
# Bump the version number | |
- name: Update Version | |
uses: MCKanpolat/[email protected] | |
id: version | |
with: | |
releaseType: ${{ github.event.inputs.type }} | |
github_token: ${{ secrets.PAT }} | |
# update the manifest.json with the new version | |
- name: Update manifest version | |
uses: jobedom/[email protected] | |
with: | |
file: manifest.json | |
field: version | |
value: ${{ steps.version.outputs.version }} | |
# update the package.json with the new version | |
- name: Update package version | |
uses: jobedom/[email protected] | |
with: | |
file: package.json | |
field: version | |
value: ${{ steps.version.outputs.version }} | |
# update the versions.json with the new version | |
- name: Update versions version | |
uses: jobedom/[email protected] | |
with: | |
file: versions.json | |
field: ${{ steps.version.outputs.version }} | |
value: "0.15.0" | |
should_split_field: false | |
# Commit the manifest.json and update the tag | |
- name: Commit manifest | |
run: | | |
git config --local user.name "GitHub Action" | |
git config --local user.email "[email protected]" | |
git branch --show-current | |
git add -u | |
git commit -m "${{ steps.version.outputs.version }}" | |
git tag -fa ${{ steps.version.outputs.version }} -m "${{ steps.version.outputs.version }}" | |
# push the commit | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{secrets.PAT}} | |
tags: true | |
branch: ${{ github.ref }} |