fix(ci): move pyproject.toml update to script file

This commit is contained in:
Luke Tainton 2024-12-25 11:25:24 +00:00
parent 3293ac0d53
commit f31c59da5b
No known key found for this signature in database
2 changed files with 10 additions and 7 deletions

View File

@ -34,13 +34,7 @@ jobs:
uses: abatilo/actions-poetry@v3
- name: Update pyproject.toml
run:
OLD_VERSION=$(grep ^version pyproject.toml | cut -d '"' -f 2)
OLD_VERSION="\"$OLD_VERSION\""
NEW_VERSION=$(echo "${{ needs.create_release.outputs.release_name }}" | cut -d '"' -f 2 | cut -d 'v' -f 2)
NEW_VERSION="\"$NEW_VERSION\""
sed -i "s+version = $OLD_VERSION+version = $NEW_VERSION+g" pyproject.toml
cat pyproject.toml
exit 1
./tools/update_pyproject.sh ${{ needs.create_release.outputs.release_name }}
- name: Install dependencies
run: poetry install
- name: Build wheel file

9
tools/update_pyproject.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
OLD_VERSION=$(grep ^version pyproject.toml | cut -d '"' -f 2)
echo "OLD_VERSION: $OLD_VERSION"
OLD_VERSION="\"$OLD_VERSION\""
NEW_VERSION=$(echo "$1" | cut -d '"' -f 2 | cut -d 'v' -f 2)
echo "NEW_VERSION: $NEW_VERSION"
NEW_VERSION="\"$NEW_VERSION\""
sed -i "s+version = $OLD_VERSION+version = $NEW_VERSION+g" pyproject.toml