diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3e344dc..c251962 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -2,7 +2,7 @@ name: Publish Python Package on: release: - types: [created] + types: [published] jobs: test: @@ -12,21 +12,27 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b with: python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: '**/pyproject.toml' - - name: Install poetry - run: | - python -m pip install poetry - - name: Install poetry - run: | - poetry install --with dev + enable-cache: true + + - name: Install project + run: uv sync --all-extras --dev + + - name: Lint with Ruff + run: uv run ruff check src/ + - name: Run tests + env: + GITHUB_TOKEN: ${{ secrets.TESTS_GITHUB_TOKEN }} + run: uv run pytest tests/ + + - name: Make sure the code can run run: | - poetry run pytest + uv run folio-data-import -h + deploy: runs-on: ubuntu-latest needs: [test] @@ -35,17 +41,16 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b with: - python-version: '3.11' - cache: pip - cache-dependency-path: '**/pyproject.toml' - - name: Install dependencies - run: | - python -m pip install poetry - - name: Build + python-version: "3.13" + enable-cache: true + - name: Install project + run: uv sync --all-extras --dev + + - name: Build wheel run: | - poetry build + uv build - name: Publish - uses: pypa/gh-action-pypi-publish@release/v1 + run: uv publish \ No newline at end of file