Skip to content

NPM bump version

NPM bump version #16

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@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PEM }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Setup environment
uses: actions/setup-node@v3.8.1
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