Skip to content

Semantic Release

Semantic Release #1

name: Semantic Release
on:
workflow_dispatch:
inputs:
updateType:
description: "version update type"
required: true
type: choice
default: "patch"
options:
- "major"
- "minor"
- "patch"
packageName:
description: "name of the package to update"
required: true
type: choice
options:
- "ragbits"
- "ragbits-cli"
- "ragbits-core"
- "ragbits-document-search"
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "0.4.10"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Update packages
id: packages_update
run: |
echo old_version=`grep version packages/${{ github.event.inputs.packageName }}/pyproject.toml | cut -d \" -f2` >> $GITHUB_OUTPUT
uv run scripts/update_ragbits_package.py ${{ github.event.inputs.packageName }} ${{ github.event.inputs.updateType }}
echo new_version=`grep version packages/${{ github.event.inputs.packageName }}/pyproject.toml | cut -d \" -f2` >> $GITHUB_OUTPUT
- name: Commit updated packages
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update ${{ github.event.inputs.packageName }} version from ${{ steps.packages_update.outputs.old_version }} to ${{ steps.packages_update.outputs.new_version }}