Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 28 additions & 23 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Python Package

on:
release:
types: [created]
types: [published]

jobs:
test:
Expand All @@ -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]
Expand All @@ -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