fix(ci): update pyproject.toml dynamically

This commit is contained in:
Luke Tainton 2024-12-25 10:55:28 +00:00
parent e95a08b87e
commit c3b5470f6f
No known key found for this signature in database

View File

@ -32,17 +32,10 @@ jobs:
python-version: "3.11" python-version: "3.11"
- name: Update pyproject.toml - name: Update pyproject.toml
run: run:
prefix="v" OLD_VERSION=$(grep ^version pyproject.toml | cut -d '"' -f 2)
echo "prefix=$prefix" OLD_VERSION="\"$OLD_VERSION\""
string="v1.3.1" NEW_VERSION="\"$GITHUB_REF_NAME\""
echo "string=$string" sed -i "s+version = $OLD_VERSION+version = $NEW_VERSION+g" pyproject.toml
versionname=${string#"$prefix"}
echo "versionname=$versionname"
oldpyprojectversion="version = \"0.0.0\""
echo "oldpyprojectversion=$oldpyprojectversion"
pyprojectversion="version = \"$versionname\""
echo "pyprojectversion=$pyprojectversion"
sed -i "s@$oldpyprojectversion@$pyprojectversion@g" pyproject.toml
- name: Setup Poetry - name: Setup Poetry
uses: abatilo/actions-poetry@v3 uses: abatilo/actions-poetry@v3
- name: Install dependencies - name: Install dependencies