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
1 change: 1 addition & 0 deletions .woodpecker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder contains scripts for testing in our own CI/CD platform based on Woodpecker CI, located in the USTC Knowledge Computing Laboratory. These scripts may contain many hard-coded absolute URLs, so they should not be used elsewhere.
65 changes: 65 additions & 0 deletions .woodpecker/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
when:
- event: push
- event: pull_request

variables:
- &docker_config
DOCKER_CACHE: /woodpecker/cache/docker
- &minio_config
MINIO_HOST: https://s3.kclab.cloud
MINIO_ACCESS_KEY:
from_secret: minio_access_key
MINIO_SECRET_KEY:
from_secret: minio_secret_key
MINIO_BUCKET: cache-53030

clone:
git:
image: woodpeckerci/plugin-git:2.6
settings:
tags: true
partial: false

steps:
- name: open cache
image: minio/mc:latest
environment:
<<: [*docker_config, *minio_config]
commands:
- mkdir --parents $${DOCKER_CACHE}
- touch $${DOCKER_CACHE}/.keep
- mc alias set minio $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
- mc cp --recursive minio/$${MINIO_BUCKET}/${CI_REPO}/docker/ $${DOCKER_CACHE}/
failure: ignore

- name: tagging
image: mcp/git:latest
commands:
- git describe --tags | tee .tag

- name: docker
image: woodpeckerci/plugin-docker-buildx:6-insecure
settings:
repo: git.kclab.cloud/hzhangxyz/qmb
username: hzhangxyz
password:
from_secret: gitea_package
registry: git.kclab.cloud
tags_file: .tag
cache-to: type=local,dest=/woodpecker/cache/docker
cache-from:
- type=local\\,src=/woodpecker/cache/docker
buildkit_config: |
[registry."docker.io"]
mirrors = ["https://docker.mirrors.kclab.cloud/"]
build_args:
PYPI_MIRROR: https://mirrors.ustc.edu.cn/pypi/simple

- name: save cache
image: minio/mc:latest
environment:
<<: [*docker_config, *minio_config]
commands:
- mc alias set minio $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
- mc cp --recursive $${DOCKER_CACHE}/ minio/$${MINIO_BUCKET}/${CI_REPO}/docker/
failure: ignore
45 changes: 45 additions & 0 deletions .woodpecker/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
when:
- event: push
- event: pull_request

variables:
- &pip_config
PIP_INDEX_URL: https://mirrors.ustc.edu.cn/pypi/simple
- &pre_commit_config
PRE_COMMIT_HOME: /woodpecker/cache/pre-commit
- &minio_config
MINIO_HOST: https://s3.kclab.cloud
MINIO_ACCESS_KEY:
from_secret: minio_access_key
MINIO_SECRET_KEY:
from_secret: minio_secret_key
MINIO_BUCKET: cache-53030

steps:
- name: open cache
image: minio/mc:latest
environment:
<<: [*pre_commit_config, *minio_config]
commands:
- mkdir --parents $${PRE_COMMIT_HOME}
- touch $${PRE_COMMIT_HOME}/.keep
- mc alias set minio $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
- mc cp --recursive minio/$${MINIO_BUCKET}/${CI_REPO}/pre-commit/ $${PRE_COMMIT_HOME}/
failure: ignore

- name: pre-commit
image: python:3.12
environment:
<<: [*pre_commit_config, *pip_config]
commands:
- pip install pre-commit
- pip install '.[dev]'
- pre-commit run --all-files

- name: save cache
image: minio/mc:latest
environment:
<<: [*pre_commit_config, *minio_config]
commands:
- mc alias set minio $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
- mc cp --recursive $${PRE_COMMIT_HOME}/ minio/$${MINIO_BUCKET}/${CI_REPO}/pre-commit/
36 changes: 36 additions & 0 deletions .woodpecker/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
when:
- event: push
- event: pull_request

variables:
- &pip_config
PIP_INDEX_URL: https://mirrors.ustc.edu.cn/pypi/simple
- &repo_config
TWINE_REPOSITORY_URL: https://git.kclab.cloud/api/packages/hzhangxyz/pypi
TWINE_USERNAME: hzhangxyz
TWINE_PASSWORD:
from_secret: gitea_package

clone:
git:
image: woodpeckerci/plugin-git:2.6
settings:
tags: true
partial: false

steps:
- name: build
image: python:3.12
environment:
<<: *pip_config
commands:
- pip install pipx
- pipx run build

- name: upload
image: python:3.12
environment:
<<: [*pip_config, *repo_config]
commands:
- pip install pipx
- pipx run twine upload dist/* --verbose
Loading