Skip to content
Merged
Show file tree
Hide file tree
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
42 changes: 19 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,38 @@ on:
- 'v*' # Runs only on version tags like v1.2.3

jobs:
build-and-publish:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -

- name: Extract tag version
id: get_tag
run: echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Set up Python & Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 - --version 2.1.3
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Validate pyproject.toml version matches tag
- name: Validate version tag matches pyproject.toml
run: |
PYPROJECT_VERSION=$(poetry version -s)
if [ "$PYPROJECT_VERSION" != "$TAG_VERSION" ]; then
echo "Version mismatch! Tag is v$TAG_VERSION but pyproject.toml has $PYPROJECT_VERSION"
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
PROJECT_VERSION=$(poetry version -s)
if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then
echo "Tag v$TAG_VERSION does not match pyproject.toml version $PROJECT_VERSION"
exit 1
fi
echo "Version check passed: $PYPROJECT_VERSION"

- name: Configure Poetry for publishing
run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}

- name: Install dependencies
run: poetry install --no-dev

- name: Build package
run: poetry build

- name: Verify with Twine
run: |
pip install --no-cache-dir twine
twine check dist/*

- name: Publish to PyPI
run: poetry publish
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![codecov](https://codecov.io/gh/mdambski/liquidity/branch/master/graph/badge.svg)](https://codecov.io/gh/mdambski/liquidity/tree/master)

![CI](https://github.com/mdambski/liquidity/actions/workflows/post-pr.yml/badge.svg)
[![Coverage](https://codecov.io/gh/mdambski/liquidity/branch/master/graph/badge.svg)](https://codecov.io/gh/mdambski/liquidity)
![PyPI](https://img.shields.io/pypi/v/liquidity)
![License](https://img.shields.io/github/license/mdambski/liquidity)

# Market Liquidity Proxies

Expand Down
16 changes: 9 additions & 7 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
version: '3'

tasks:
install-deps:
desc: Install all dependencies (runtime + dev)
cmds:
- poetry install --with dev

delint:
desc: Run Ruff in fix and format mode
desc: Autofix & format code
cmds:
- poetry run ruff check --fix-only
- poetry run ruff format .
- poetry run mypy . --pretty --strict

lint:
desc: Run Ruff in check mode and MyPy
desc: Verify code styles & types
cmds:
- poetry run ruff check
- poetry run ruff format . --check
- poetry run mypy . --pretty --strict

test:
desc: Run unit tests with coverage
deps: [install-deps]
cmds:
- poetry run pytest tests/ --cov=liquidity --ignore tests/e2e --cov-report=xml

test-e2e:
desc: Run end-to-end tests
deps: [install-deps]
cmds:
- poetry run pytest tests/e2e

install-deps:
desc: Install development dependencies
cmds:
- poetry install --with dev
Loading