Skip to content

Commit

Permalink
Use toml-cli instead of grep/sed to get/set pre-release project version
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Jan 16, 2025
1 parent bacf0ec commit 06b5b8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
pre-release-suffix: ${{ github.event.inputs.pre-release-suffix || 'dev' }}
pre-release-version: ${{ github.event.inputs.pre-release-version || github.run_number }}
run: |
PKG_VERSION=$(grep '^version =' pyproject.toml | sed -E 's/version = [\'"](.*)[\'"]/\1/')
PKG_VERSION=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)
DEV_VERSION=$PKG_VERSION.${{ env.pre-release-suffix }}${{ env.pre-release-version }}
echo "Setting pre-release version to $DEV_VERSION"
sed -i "s/^version = .*/version = \"$DEV_VERSION\"/" pyproject.toml
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version $DEV_VERSION
- name: Build package distributions
run: uv build
Expand Down

0 comments on commit 06b5b8e

Please # to comment.