From 90d881a166542e85edc244d5f9e7e56e180a9b3f Mon Sep 17 00:00:00 2001 From: felinae98 <731499577@qq.com> Date: Thu, 17 Jun 2021 11:13:49 +0800 Subject: [PATCH] update ci --- .circleci/config.yml | 57 +++++++++++++++++++++++++++++++------------- CHANGELOG.md | 6 +++++ Dockerfile | 4 ++-- pyproject.toml | 2 +- 4 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.circleci/config.yml b/.circleci/config.yml index 1453617..5608117 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,32 +7,55 @@ orbs: # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python python: circleci/python@1.2 poetry: frameio/poetry@0.21.0 + swissknife: roopakv/swissknife@0.59.0 workflows: - sample: # This is the name of the workflow, feel free to change it to better match your workflow. - # Inside the workflow, you define the jobs you want to run. - # For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows + build-test-publish: jobs: - - build-and-test - + - install + - test: + requires: + - install + - build: + requires: + - test + filters: + tags: + only: /^v.*/ + - publish: + requires: + - build + filters: + tags: + only: /^v.*/ jobs: - build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do! - # These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/ - # You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub - # A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python - # The executor is the environment in which the steps below will be executed - below will use a python 3.9 container - # Change the version below to your required version of python + install: docker: - image: cimg/python:3.9 - # Checkout the code as the first step. This is a dedicated CircleCI step. - # The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default. - # Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt. - # Then run your tests! - # CircleCI will report the results back to your VCS provider. steps: - checkout - poetry/install + test: + docker: + - image: cimg/python:3.9 + steps: - poetry/shell: - args: pytest + args: pytest --junitxml=test-results/junit.xml + - store_test_results: + path: test-results + build: + docker: + - image: cimg/python:3.9 + steps: + - run: poetry build + - store_artifacts: + path: dist + - swissknife/publish_github_release: + tag: ${CIRCLE_TAG} + publish: + docker: + - image: cimg/python:3.9 + steps: + - run: poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..86d4bbb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Change Log + +## [0.2.11] - 2021-06-17 +- 增加了简单的单元测试 +- 增加了管理员直接管理订阅的能力 + diff --git a/Dockerfile b/Dockerfile index 1b1f4ad..97b9846 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.9 -RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free\ndeb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free" > /etc/apt/sources.list && \ - apt-get update && apt-get install -y fonts-wqy-microhei chromium +RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free\ndeb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free" > /etc/apt/sources.list +RUN apt-get update && apt-get install -y fonts-wqy-microhei chromium RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple RUN python3 -m pip install poetry && poetry config virtualenvs.create false WORKDIR /app diff --git a/pyproject.toml b/pyproject.toml index e6a2556..3e82daf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nonebot-hk-reporter" -version = "0.2.10" +version = "0.2.11" description = "Subscribe message from social medias" authors = ["felinae98 "] license = "MIT"