CI: build python package
Some checks failed
/ test (push) Failing after 1s
/ build (push) Has been skipped

This commit is contained in:
phil 2024-12-06 03:05:43 +01:00
parent 5c27a26e78
commit 23afaa7c82

View file

@ -17,13 +17,13 @@ jobs:
test:
runs-on: container
container:
image: tiptop:5000/treetrail-backend-ci
image: code.philo.ydns.eu/philorg/treetrail-backend-ci
volumes:
- "uv_cache:/root/.cache/uv"
- "ca-cert:/etc/containers/certs.d"
services:
treetrail-database:
image: tiptop:5000/treetrail-database
image: code.philo.ydns.eu/philorg/treetrail-database
steps:
- name: Echo env
if: ${{ inputs.verbose }}
@ -58,7 +58,7 @@ jobs:
echo "run=$RUN" >> $GITHUB_OUTPUT
echo "Run build: $RUN"
- name: Info - version and if the image container should be built
- name: Info - version and test if the git version is clean (then python package and image container should be built)
env:
VERSION: ${{ steps.version.outputs.version }}
RUN: ${{ steps.builder.outputs.run }}
@ -66,6 +66,22 @@ jobs:
run: |
echo "Version $VERSION, force (manual input): $FORCE, run the build: $RUN"
- name: Set the version in pyproject.toml (workaround for uv not supporting dynamic version)
if: fromJSON(steps.builder.outputs.run)
env:
VERSION: ${{ steps.version.outputs.version }}
run: sed "s/0.0.0/${VERSION}/" -i pyproject.toml
- name: Build python package
if: fromJSON(steps.builder.outputs.run)
run: uv build --wheel
- name: Publish Python package (home)
if: fromJSON(steps.builder.outputs.run)
env:
LOCAL_PYPI_TOKEN: ${{ secrets.LOCAL_PYPI_TOKEN }}
run: uv publish --publish-url https://code.philo.ydns.eu/api/packages/philorg/pypi --token $LOCAL_PYPI_TOKEN
- name: Workaround for bug of podman-login
if: fromJSON(steps.builder.outputs.run)
run: |