From 33a4ad3ad04260deb395f3675d8e234e9ad14db8 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 26 Jun 2025 18:23:41 +0200 Subject: [PATCH] CI: switch to woodpecker --- .forgejo/workflows/build.yaml | 48 ----------------------------------- .woodpecker/build.yaml | 39 ++++++++++++++++++++++++++++ .woodpecker/test.yaml | 21 +++++++++++++++ 3 files changed, 60 insertions(+), 48 deletions(-) delete mode 100644 .forgejo/workflows/build.yaml create mode 100644 .woodpecker/build.yaml create mode 100644 .woodpecker/test.yaml diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml deleted file mode 100644 index 1b98290..0000000 --- a/.forgejo/workflows/build.yaml +++ /dev/null @@ -1,48 +0,0 @@ -on: - push: - workflow_dispatch: - inputs: - verbose: - description: "Verbose" - required: false - default: false - type: boolean - -jobs: - build: - runs-on: container - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install the latest version of uv - uses: astral-sh/setup-uv@v4 - with: - version: "0.7.6" - - - name: Install - run: uv sync - - - name: Get version - run: echo "VERSION=$(.venv/bin/dunamai from any --style semver)" >> $GITHUB_ENV - - - name: Version - run: echo $VERSION - - - name: Get distance from tag - run: echo "DISTANCE=$(.venv/bin/dunamai from any --format '{distance}')" >> $GITHUB_ENV - - - name: Distance - run: echo $DISTANCE - - - name: Build wheel - if: env.DISTANCE == '0' - run: uv build --wheel - - - name: Publish Python package (home) - if: env.DISTANCE == '0' - env: - LOCAL_PYPI_TOKEN: ${{ secrets.LOCAL_PYPI_TOKEN }} - run: uv publish --publish-url https://code.philo.ydns.eu/api/packages/K-Net/pypi --token $LOCAL_PYPI_TOKEN - continue-on-error: true diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..5d11a5f --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,39 @@ +when: + - event: manual + - event: tag + +#depends_on: + #- test + +steps: + python_sync: + image: code.philo.ydns.eu/philorg/uv + volumes: + - uv-cache:/uv-cache + environment: + UV_CACHE_DIR: /uv-cache + UV_LINK_MODE: copy + commands: + - uv sync + + python_build: + image: code.philo.ydns.eu/philorg/uv + volumes: + - uv-cache:/uv-cache + environment: + UV_CACHE_DIR: /uv-cache + UV_LINK_MODE: copy + commands: + - uv build --wheel + - uv cache prune --ci + + python_publish: + image: code.philo.ydns.eu/philorg/uv + environment: + OWNER: K-Net + REGISTRY_URL: https://code.philo.ydns.eu + REGISTRY_TOKEN: + from_secret: registry_token + commands: + - uv publish --publish-url $REGISTRY_URL/api/packages/$OWNER/pypi --token $REGISTRY_TOKEN dist/*.whl + failure: ignore diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml new file mode 100644 index 0000000..6326edc --- /dev/null +++ b/.woodpecker/test.yaml @@ -0,0 +1,21 @@ +when: + - event: push + branch: main + - event: manual + - event: tag + +steps: + sync: + image: code.philo.ydns.eu/philorg/uv + volumes: + - uv-cache:/uv-cache + environment: + UV_CACHE_DIR: /uv-cache + UV_LINK_MODE: copy + commands: + - uv sync + + test: + image: ghcr.io/astral-sh/uv:python3.13-alpine + commands: + - .venv/bin/pytest -s tests/basic.py