Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/increment-project-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Increment project version

on:
workflow_dispatch:
inputs:
type:
description: 'Version increment type'
required: true
type: choice
options:
- patch
- minor
- major

permissions:
contents: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'

- name: Set package version
id: version
run: |
npm pkg get version
npm version ${{ github.event.inputs.type }} --no-git-tag-version
UPDATED_VERSION=$(npm pkg get version | tr -d '"')
echo "updated_version=$UPDATED_VERSION" >> $GITHUB_OUTPUT

- name: Install dependencies
run: |-
npm install
cd example-app
npm install

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: "Increment project version to ${{ steps.version.outputs.updated_version }}"
body: "This PR increments the project version to ${{ steps.version.outputs.updated_version }}."
base: development
branch: increment-project-version-${{ steps.version.outputs.updated_version }}
commit-message: "chore: increment project version to ${{ steps.version.outputs.updated_version }}"