Skip to content

NPM bump version

NPM bump version #20

name: NPM bump version
on:
workflow_dispatch:
inputs:
version:
description: 'Semver type of new version (major / minor / patch)'
required: true
type: choice
options:
- patch
- minor
- major
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PEM }}
- uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Setup environment
uses: actions/setup-node@v4.0.0
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Build package
run: yarn build
- name: Run tests
run: yarn test
- name: Setup Git
run: |
git config user.name 'grafana-delivery-bot[bot]'
git config user.email '132647405+grafana-delivery-bot[bot]@users.noreply.github.com'
- name: bump version
run: npm version ${{ github.event.inputs.version }}
- name: Push latest version
run: git push origin main --follow-tags