Compare commits
24 commits
Author | SHA1 | Date | |
---|---|---|---|
763e9aa70b | |||
d1c9bc1c01 | |||
9a948fde8e | |||
e5e6c029fa | |||
1190718e98 | |||
9dd00e3deb | |||
caedb1fe52 | |||
d4dcbac8d9 | |||
a5518752fe | |||
5fd6681571 | |||
0dfccc3392 | |||
feff5a08b6 | |||
8916c5e6b0 | |||
9498ae680c | |||
5fb9b992fa | |||
01bc102185 | |||
79850e9f0a | |||
4685127011 | |||
8b334f1e6d | |||
7b3089ada1 | |||
5747745304 | |||
47c5182a99 | |||
772c4a94fb | |||
2bf168476a |
8 changed files with 69 additions and 29 deletions
|
@ -6,8 +6,22 @@ depends_on:
|
||||||
- test
|
- test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
container_build_release_push:
|
||||||
|
#image: docker.io/maltegrosse/woodpecker-buildah:0.0.12
|
||||||
|
image: code.philo.ydns.eu/philorg/woodpecker-buildah
|
||||||
|
settings:
|
||||||
|
registry: code.philo.ydns.eu
|
||||||
|
repository: philorg/test-woodpecker-python
|
||||||
|
tags: ${CI_COMMIT_SHA}
|
||||||
|
architectures: amd64
|
||||||
|
context: Containerfile
|
||||||
|
username:
|
||||||
|
from_secret: registry_username
|
||||||
|
password:
|
||||||
|
from_secret: registry_password
|
||||||
|
|
||||||
sync:
|
sync:
|
||||||
image: ghcr.io/astral-sh/uv:python3.13-alpine
|
image: code.philo.ydns.eu/philorg/uv
|
||||||
volumes:
|
volumes:
|
||||||
- uv-cache:/uv-cache
|
- uv-cache:/uv-cache
|
||||||
environment:
|
environment:
|
||||||
|
@ -17,7 +31,7 @@ steps:
|
||||||
- uv sync
|
- uv sync
|
||||||
|
|
||||||
build:
|
build:
|
||||||
image: ghcr.io/astral-sh/uv:python3.13-alpine
|
image: code.philo.ydns.eu/philorg/uv
|
||||||
volumes:
|
volumes:
|
||||||
- uv-cache:/uv-cache
|
- uv-cache:/uv-cache
|
||||||
environment:
|
environment:
|
||||||
|
@ -26,22 +40,14 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- uv build --wheel
|
- uv build --wheel
|
||||||
- uv cache prune --ci
|
- uv cache prune --ci
|
||||||
|
|
||||||
push_python:
|
push_python:
|
||||||
image: ghcr.io/astral-sh/uv:python3.13-alpine
|
image: code.philo.ydns.eu/philorg/uv
|
||||||
environment:
|
environment:
|
||||||
OWNER: philorg
|
OWNER: philorg
|
||||||
REGISTRY_URL: https://code.philo.ydns.eu
|
REGISTRY_URL: https://code.philo.ydns.eu
|
||||||
REGISTRY_TOKEN:
|
REGISTRY_TOKEN:
|
||||||
from_secret: registry_token
|
from_secret: registry_token
|
||||||
commands:
|
commands:
|
||||||
- uv publish --publish-url $REGISTRY_URL/api/packages/$OWNER/pypi -u __token__ --token REGISTRY_TOKEN dist/*.whl
|
- uv publish --publish-url $REGISTRY_URL/api/packages/$OWNER/pypi --token $REGISTRY_TOKEN dist/*.whl
|
||||||
failure: ignore
|
failure: ignore
|
||||||
|
|
||||||
# TODO: container
|
|
||||||
# For podman build: see https://woodpecker-ci.org/blog/podman-image-build-sigstore
|
|
||||||
# podman-privileged-test:
|
|
||||||
# image: quay.io/podman/stable
|
|
||||||
# commands:
|
|
||||||
# - echo From https://docs.gitlab.com/runner/executors/kubernetes/use_podman_with_kubernetes/
|
|
||||||
# - podman build . -t playground-bis:testing
|
|
||||||
|
|
|
@ -5,9 +5,8 @@ when:
|
||||||
- event: tag
|
- event: tag
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
sync:
|
sync:
|
||||||
image: ghcr.io/astral-sh/uv:python3.13-alpine
|
image: code.philo.ydns.eu/philorg/uv
|
||||||
volumes:
|
volumes:
|
||||||
- uv-cache:/uv-cache
|
- uv-cache:/uv-cache
|
||||||
environment:
|
environment:
|
||||||
|
@ -17,7 +16,6 @@ steps:
|
||||||
- uv sync
|
- uv sync
|
||||||
|
|
||||||
test:
|
test:
|
||||||
#image: ghcr.io/astral-sh/uv:alpine
|
|
||||||
image: ghcr.io/astral-sh/uv:python3.13-alpine
|
image: ghcr.io/astral-sh/uv:python3.13-alpine
|
||||||
commands:
|
commands:
|
||||||
- .venv/bin/pytest -s tests/basic.py
|
- .venv/bin/pytest -s tests/basic.py
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
# Build: podman build -t code.philo.ydns.eu/philorg/test-woodpecker -f Containerfile
|
# Build: podman build -t code.philo.ydns.eu/philorg/test-woodpecker -f Containerfile
|
||||||
|
|
||||||
#FROM docker.io/python:3.13-slim
|
|
||||||
FROM docker.io/python:alpine
|
FROM docker.io/python:alpine
|
||||||
#FROM ghcr.io/astral-sh/uv:python3.13-alpine
|
|
||||||
#RUN apk add --no-cache git
|
|
||||||
#COPY --from=ghcr.io/astral-sh/uv:python3.13-alpine /usr/local/bin/uv /usr/local/bin/
|
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
# Sync the project into a new environment, using the frozen lockfile
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN --mount=from=ghcr.io/astral-sh/uv:alpine,source=/usr/local/bin/uv,target=/bin/uv uv pip install --system .
|
# Sync the project into a new environment, using the frozen lockfile
|
||||||
|
RUN \
|
||||||
|
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/local/bin/uv,target=/bin/uv \
|
||||||
|
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/lib/libpcre2-8.so.0,target=/usr/lib/libpcre2-8.so.0 \
|
||||||
|
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/bin/git,target=/usr/bin/git \
|
||||||
|
uv pip install --system .
|
||||||
|
|
||||||
ENTRYPOINT ["foo"]
|
ENTRYPOINT ["foo"]
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
# test-woodpecker-ci
|
# test-woodpecker-ci
|
||||||
|
|
||||||
Yo
|
[](https://code.philo.ydns.eu/woodpecker/repos/5)
|
||||||
|
|
||||||
|
This is a sandbox for building packages (pypi and container) with Woodpecker CI.
|
|
@ -1,7 +1,7 @@
|
||||||
[project]
|
[project]
|
||||||
name = "test-woodpecker-ci"
|
name = "test-woodpecker-ci"
|
||||||
version = "0.1.0"
|
dynamic = ["version"]
|
||||||
description = "Add your description here"
|
description = "Sandbox for Woodpecker CI"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
dependencies = []
|
dependencies = []
|
||||||
|
@ -10,11 +10,22 @@ dependencies = []
|
||||||
foo = "test_woodpecker_ci.main:main"
|
foo = "test_woodpecker_ci.main:main"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["hatchling"]
|
requires = ["hatchling", "uv-dynamic-versioning"]
|
||||||
build-backend = "hatchling.build"
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
|
[tool.hatch.version]
|
||||||
|
source = "uv-dynamic-versioning"
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = ["src/test_woodpecker_ci"]
|
packages = ["src/test_woodpecker_ci"]
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
dev = ["httpx>=0.28.1", "pytest>=8.4.1"]
|
dev = ["dunamai>=1.24.1", "httpx>=0.28.1", "pytest>=8.4.1"]
|
||||||
|
|
||||||
|
[tool.uv-dynamic-versioning]
|
||||||
|
style = "semver"
|
||||||
|
|
||||||
|
[tool.uv]
|
||||||
|
extra-index-url = [
|
||||||
|
"https://code.philo.ydns.eu/api/packages/philorg/pypi/simple/",
|
||||||
|
]
|
||||||
|
|
10
src/test_woodpecker_ci/__init__.py
Normal file
10
src/test_woodpecker_ci/__init__.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import importlib.metadata
|
||||||
|
|
||||||
|
try:
|
||||||
|
from dunamai import Version, Style
|
||||||
|
|
||||||
|
__version__ = Version.from_git().serialize(style=Style.SemVer, dirty=True)
|
||||||
|
except ImportError:
|
||||||
|
# __name__ can be used if the package name is the same
|
||||||
|
# as the directory. Otherwise, specify it explicitely.
|
||||||
|
__version__ = importlib.metadata.version(__name__)
|
|
@ -2,5 +2,5 @@ def test_ok():
|
||||||
assert True
|
assert True
|
||||||
|
|
||||||
|
|
||||||
def test_fail():
|
def no_test_fail():
|
||||||
assert False
|
assert False
|
||||||
|
|
15
uv.lock
generated
15
uv.lock
generated
|
@ -33,6 +33,18 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dunamai"
|
||||||
|
version = "1.24.1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "packaging" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/54/22/7f46b0146ef614cd6f80e4bcb188dabe33e90b4e0af028e16f597f5826ad/dunamai-1.24.1.tar.gz", hash = "sha256:3aa3348f77242da8628b23f11e89569343440f0f912bcef32a1fa891cf8e7215", size = 45616, upload-time = "2025-05-09T13:48:46.417Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/1d/d6/6ed8b439906ca2e88d65bddf002e21239678aca6001d8fb82e8e2b196245/dunamai-1.24.1-py3-none-any.whl", hash = "sha256:4370e406d8ce195fc4b066b5c326bfa9adb269c4b8719b4e4fd90b63a2144bf7", size = 26654, upload-time = "2025-05-09T13:48:45.442Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "h11"
|
name = "h11"
|
||||||
version = "0.16.0"
|
version = "0.16.0"
|
||||||
|
@ -142,11 +154,11 @@ wheels = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "test-woodpecker-ci"
|
name = "test-woodpecker-ci"
|
||||||
version = "0.1.0"
|
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
|
|
||||||
[package.dev-dependencies]
|
[package.dev-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
|
{ name = "dunamai" },
|
||||||
{ name = "httpx" },
|
{ name = "httpx" },
|
||||||
{ name = "pytest" },
|
{ name = "pytest" },
|
||||||
]
|
]
|
||||||
|
@ -155,6 +167,7 @@ dev = [
|
||||||
|
|
||||||
[package.metadata.requires-dev]
|
[package.metadata.requires-dev]
|
||||||
dev = [
|
dev = [
|
||||||
|
{ name = "dunamai", specifier = ">=1.24.1" },
|
||||||
{ name = "httpx", specifier = ">=0.28.1" },
|
{ name = "httpx", specifier = ">=0.28.1" },
|
||||||
{ name = "pytest", specifier = ">=8.4.1" },
|
{ name = "pytest", specifier = ">=8.4.1" },
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue