From 5b3014a3b1659195073fcf6402dff8638d6af59b Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 4 Jan 2024 14:37:45 +0530 Subject: [PATCH] (ci/cd) read version from pyproject --- .github/workflows/read_pyproject_version.yml | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/read_pyproject_version.yml diff --git a/.github/workflows/read_pyproject_version.yml b/.github/workflows/read_pyproject_version.yml new file mode 100644 index 000000000..652c080d0 --- /dev/null +++ b/.github/workflows/read_pyproject_version.yml @@ -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 }}"