Skip to content

Bump Version for a package #1

Bump Version for a package

Bump Version for a package #1

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Bump Version for a package
on:
workflow_dispatch:
inputs:
packageDir:
description: Package dir (ex. js/foo)
type: string
required: true
packageName:
description: Package name (ex. @genkit-ai/foo)
type: string
required: true
releaseType:
description: Release type
type: choice
default: patch
required: true
options:
- patch
- minor
- major
- prerelease
- premajor
- preminor
- prepatch
preid:
description: Prerelease identifier
type: string
default: rc
required: true
jobs:
build:
name: Version bump
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GENKIT_RELEASER_GITHUB_TOKEN }}
- uses: pnpm/action-setup@v3
- name: Set up node v20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- name: 'version bump'
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GENKIT_RELEASER_GITHUB_TOKEN }}
PACKAGEJSON_DIR: ${{ inputs.packageDir }}
with:
default: ${{ inputs.releaseType }}
version-type: ${{ inputs.releaseType }}
preid: ${{ inputs.preid }}
commit-message: 'chore: bump ${{ inputs.packageName }} version to {{version}}'
tag-prefix: '${{ inputs.packageName }}@'