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
49 changes: 7 additions & 42 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,15 @@ name: Publish to PyPI

on:
push:
tags:
- "v*"
tags: ["v*"]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
pip install -e ".[all]"
pip install pytest-asyncio

- name: Lint
run: ruff check .

- name: Test
run: pytest

publish:
needs: test
runs-on: ubuntu-latest
uses: liuxiaotong/knowlyr-workflows/.github/workflows/reusable-publish-pypi.yml@main
with:
build_tool: "setuptools"
run_tests: true
test_command: "pytest tests/"
permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build tools
run: pip install build

- name: Build package
run: python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
contents: read
Loading