bump version 0.3.x -> 0.4.0 #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Packages | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: publish-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| publish: | |
| name: Build And Publish Workspace | |
| runs-on: ubuntu-latest | |
| env: | |
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
| steps: | |
| - name: Check Out Repository | |
| uses: actions/checkout@v4 | |
| - name: Set Up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Set Up uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Validate Release | |
| run: | | |
| uv sync --all-extras | |
| make prod | |
| - name: Build And Publish Root, Adapter, And Helper Projects | |
| shell: bash | |
| run: | | |
| project_dirs() { | |
| if [ -d packages/helpers ]; then | |
| find packages/helpers -type f -name pyproject.toml -exec dirname {} \; | sort -u | |
| fi | |
| if [ -d packages/adapters ]; then | |
| find packages/adapters -type f -name pyproject.toml -exec dirname {} \; | sort -u | |
| fi | |
| printf '.\n' | |
| } | |
| sync_project() { | |
| local project_dir="$1" | |
| local pyproject_path="$project_dir/pyproject.toml" | |
| if grep -Eq '^\[project\.optional-dependencies\]' "$pyproject_path"; then | |
| uv sync --project "$project_dir" --all-extras | |
| else | |
| uv sync --project "$project_dir" | |
| fi | |
| } | |
| while IFS= read -r project_dir; do | |
| echo "==> Publishing $project_dir" | |
| sync_project "$project_dir" | |
| rm -rf "$project_dir/dist" | |
| uv build --project "$project_dir" --out-dir "$project_dir/dist" | |
| uv publish "$project_dir"/dist/* | |
| done < <(project_dirs) |