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
34 changes: 0 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,37 +44,3 @@ jobs:

- name: Run pytest
run: uv run pytest

publish:
needs: [pytest]
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.LATEST_PY_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flit
python -m pip install .

- name: Set tag version
id: tag
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Set module version
id: module
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: echo ::set-output name=version::$(python -c 'from importlib.metadata import version; print(version("aiopmtiles"))')

- name: Build and publish
if: steps.tag.outputs.tag == steps.module.outputs.version
env:
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }}
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: flit publish
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

# Only run on new tags starting with `v`
on:
push:
tags:
- "v*"

jobs:
build:
name: Build dist
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"

- name: Build dist
run: |
uv run python -m build

- uses: actions/upload-artifact@v6
with:
path: ./dist/

upload_pypi:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v7
with:
name: artifact
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}