diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e993271..db443e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,17 +3,46 @@ name: Release on: push: tags: - - '*.*.*' + - 'v*.*.*' jobs: + wait-for-tests: + name: Wait for Tests + runs-on: ubuntu-latest + steps: + - name: Wait for Tests workflow to pass + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "Waiting for Tests workflow on commit ${{ github.sha }}..." + for i in $(seq 1 60); do + result=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/check-runs \ + --jq '.check_runs[] | select(.name | test("Ubuntu|MacOS|Windows")) | .conclusion' 2>/dev/null || true) + if echo "$result" | grep -q "failure"; then + echo "Tests failed — aborting release." + exit 1 + fi + total=$(echo "$result" | wc -l | tr -d ' ') + passed=$(echo "$result" | grep -c "success" || true) + if [ "$total" -gt 0 ] && [ "$total" -eq "$passed" ]; then + echo "All $total test jobs passed." + exit 0 + fi + echo "Attempt $i: $passed/$total jobs passed so far, waiting 30s..." + sleep 30 + done + echo "Timed out waiting for Tests workflow." + exit 1 + release: name: Release + needs: wait-for-tests runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: python-version: "3.12" @@ -42,8 +71,8 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} draft: false prerelease: steps.check-version.outputs.prerelease == 'true' - + - name: Publish to PyPI env: POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} - run: poetry publish \ No newline at end of file + run: poetry publish diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9fcb947..d2b9390 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [Ubuntu, MacOS, Windows] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] fail-fast: false defaults: run: @@ -34,7 +34,11 @@ jobs: - name: Bootstrap poetry run: | - curl -sSL https://install.python-poetry.org | python - -y + if [ "${{ matrix.python-version }}" = "3.9" ]; then + curl -sSL https://install.python-poetry.org | python - -y --version 1.8.5 + else + curl -sSL https://install.python-poetry.org | python - -y + fi - name: Update PATH if: ${{ matrix.os != 'Windows' }} @@ -60,7 +64,12 @@ jobs: timeout 10s poetry run pip --version || rm -rf .venv - name: Check lock file - run: poetry lock --check + run: | + if [ "${{ matrix.python-version }}" = "3.9" ]; then + poetry lock --check + else + poetry check --lock + fi - name: Install dependencies run: poetry install --without examples diff --git a/CHANGELOG.md b/CHANGELOG.md index dcd2a65..5213045 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,13 @@ # Change Log -## [0.12.2] - 2025-02-20 +## [0.12.3] - 2025-02-20 - Fixed `__version__` in `lato/__init__.py` to match release version - Removed EOL `pypy-3.8` from CI test matrix -- Dropped Python 3.9 from CI (Poetry 2.x requires Python 3.10+) -- Updated release workflow to use Python 3.12 +- Fixed CI compatibility with Poetry 2.x (`poetry check --lock`) +- Pin Poetry 1.8.5 for Python 3.9 CI jobs +- Gate release workflow on Tests passing +- Updated release workflow to Python 3.12 ## [0.12.0] - 2025-01-02 diff --git a/lato/__init__.py b/lato/__init__.py index 0f1f18b..a6cca47 100644 --- a/lato/__init__.py +++ b/lato/__init__.py @@ -9,7 +9,7 @@ from .message import Command, Event, Query from .transaction_context import TransactionContext -__version__ = "0.12.2" +__version__ = "0.12.3" __all__ = [ "Application", "ApplicationModule", diff --git a/pyproject.toml b/pyproject.toml index bd6260e..accea5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "lato" -version = "0.12.2" +version = "0.12.3" description = "Lato is a Python microframework designed for building modular monoliths and loosely coupled applications." authors = ["Przemysław Górecki "] readme = "README.md"