(ci/cd) read version from pyproject

This commit is contained in:
ishaan-jaff 2024-01-04 14:37:45 +05:30
parent 4aa90682ff
commit 5b3014a3b1

View file

@ -0,0 +1,31 @@
name: Read Version from pyproject.toml
on:
workflow_dispatch:
inputs:
tag:
description: "The tag version you want to build"
jobs:
read-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8 # Adjust the Python version as needed
- name: Install dependencies
run: pip install toml
- name: Read version from pyproject.toml
id: read-version
run: echo "::set-output name=version::$(toml get pyproject.toml tool.commitizen.version)"
- name: Display version
run: echo "Current version is ${{ steps.read-version.outputs.version }}"