CI: switch to woodpecker
This commit is contained in:
parent
e0339c940d
commit
33a4ad3ad0
3 changed files with 60 additions and 48 deletions
|
@ -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
|
39
.woodpecker/build.yaml
Normal file
39
.woodpecker/build.yaml
Normal file
|
@ -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
|
21
.woodpecker/test.yaml
Normal file
21
.woodpecker/test.yaml
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue