diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f86d0f2..9e67cc9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,6 +5,10 @@ on: branches: [ main ] workflow_dispatch: # Allows manual triggering +# Required permissions for the workflow to function properly +permissions: + contents: write # Needed to push version bump commit and tags + jobs: deploy: runs-on: ubuntu-latest @@ -32,8 +36,8 @@ jobs: - name: Bump version id: version_bump run: | - # Extract current version from pyproject.toml - CURRENT_VERSION=$(awk -F'"' '/^version =/ {print $4}' pyproject.toml) + # Extract current version from pyproject.toml - more robust pattern + CURRENT_VERSION=$(grep -o 'version = "[0-9]*\.[0-9]*\.[0-9]*"' pyproject.toml | grep -o '[0-9]*\.[0-9]*\.[0-9]*') # Trim any whitespace CURRENT_VERSION=$(echo "$CURRENT_VERSION" | xargs) echo "Current version: '$CURRENT_VERSION'" @@ -41,6 +45,9 @@ jobs: # Validate version format if [[ ! "$CURRENT_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Error: Invalid version format: $CURRENT_VERSION" + cat pyproject.toml # Debug: print the file contents + echo "---" + grep "version" pyproject.toml # Debug: check for version line exit 1 fi diff --git a/pyproject.toml b/pyproject.toml index 5a3b761..f9d957a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "datafast" -version = "0.0.9" +version = "0.0.10" description = "A Python package for synthetic text dataset generation" readme = "README.md" license = { file = "LICENSE" }