diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aca8531..e9248d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,39 +21,30 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.8.x - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: '3.8.x' - - - - name: Install build dependencies - uses: py-actions/py-dependency-install@v4 - with: - update-pip: "true" - update-setuptools: "true" - update-wheel: "true" - path: "requirements.txt" - - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - - name: Creating dist files - run: | - python setup.py sdist - python setup.py bdist_wheel --universal - shell: bash + python-version: '3.12' - - name: CheckFiles + - name: Check release version + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + python - <<'PY' + import os + import runpy + version = runpy.run_path('mapilio_kit/components/version.py')['VERSION'] + if os.environ['RELEASE_TAG'] != f'v{version}': + raise SystemExit('Release tag must match the package version') + PY + + - name: Build and check distributions run: | - ls dist - shell: bash - + python -m pip install build twine + python -m build + python -m twine check dist/* + - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 31d569a..67526d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,6 +14,20 @@ concurrency: cancel-in-progress: true jobs: + package: + name: Build distributions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Build a wheel from the source distribution + run: | + python -m pip install build twine + python -m build + python -m twine check dist/* + test: name: pytest (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest diff --git a/MANIFEST.in b/MANIFEST.in index 1001e08..97679eb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include LICENSE include README.md +include requirements.txt diff --git a/mapilio_kit/components/version.py b/mapilio_kit/components/version.py index 576283f..b2d6a66 100644 --- a/mapilio_kit/components/version.py +++ b/mapilio_kit/components/version.py @@ -4,4 +4,4 @@ reads ``VERSION`` from this module via ``exec``. """ -VERSION = "3.0.6" +VERSION = "3.0.7"