fix(ci): move pyproject.toml update to script file
This commit is contained in:
parent
3293ac0d53
commit
f31c59da5b
8
.github/workflows/publish.yml
vendored
8
.github/workflows/publish.yml
vendored
@ -34,13 +34,7 @@ jobs:
|
|||||||
uses: abatilo/actions-poetry@v3
|
uses: abatilo/actions-poetry@v3
|
||||||
- name: Update pyproject.toml
|
- name: Update pyproject.toml
|
||||||
run:
|
run:
|
||||||
OLD_VERSION=$(grep ^version pyproject.toml | cut -d '"' -f 2)
|
./tools/update_pyproject.sh ${{ needs.create_release.outputs.release_name }}
|
||||||
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
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: poetry install
|
run: poetry install
|
||||||
- name: Build wheel file
|
- name: Build wheel file
|
||||||
|
9
tools/update_pyproject.sh
Executable file
9
tools/update_pyproject.sh
Executable 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
|
Loading…
x
Reference in New Issue
Block a user