Skip to content

Create new version (package.json & CHANGELOG) #34

Create new version (package.json & CHANGELOG)

Create new version (package.json & CHANGELOG) #34

name: Create new version (package.json & CHANGELOG)
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'minor'
type: choice
options:
- patch
- minor
- major
jobs:
create-new-version:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: 0
fetch-tags: true
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- uses: tibdex/github-app-token@v1
id: get_installation_token
with:
app_id: ${{ secrets.DB_FE_GITHUB_APP_ID }}
installation_id: ${{ secrets.DB_FE_GITHUB_APP_INSTALLATION_ID }}
private_key: ${{ secrets.DB_FE_GITHUB_APP_PRIVATE_KEY }}
- name: Create version & update CHANGELOG
env:
DB_FE_CI_BOT_EMAIL: ${{ secrets.DB_FE_CI_BOT_EMAIL }}
run: |
git config --global user.email "$DB_FE_CI_BOT_EMAIL"
git config --global user.name "Databases Frontend CI Bot"
git config --global url.https://${{ steps.get_installation_token.outputs.token }}@github.com/.insteadOf https://github.com/
npm version ${{ inputs.version }}
- name: Push
run: git push origin main --tags