From 29f853b6ca2a4b2bb0c012a0c77ca4cf242e7a8f Mon Sep 17 00:00:00 2001 From: jstzwj <1103870790@qq.com> Date: Wed, 31 Jan 2024 21:24:19 +0800 Subject: [PATCH] add actions configs --- .github/dependabot.yml | 11 +++++++++ .github/workflows/dev.yml | 30 +++++++++++++++++++++++ .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/dev.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..91abb11 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..8d1d36b --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,30 @@ +name: ChatProto GitHub Actions for Development +run-name: ChatProto GitHub Actions for Development +on: + push: + branches: [ "main", "dev" ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["pypy3.9", "pypy3.10", "3.9", "3.10", "3.11"] + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install ChatProto + run: | + cd ${{ github.workspace }} + pip install --upgrade pip + pip install -e . + + - name: Test ChatProto + run: | + cd ${{ github.workspace }} + python -m unittest discover ChatProto/tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0344967 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: ChatProto GitHub Actions to release +run-name: ChatProto GitHub Actions to release +on: + push: + tags: + - "v*" + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["pypy3.9", "pypy3.10", "3.9", "3.10", "3.11"] + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install ChatProto + run: | + cd ${{ github.workspace }} + pip install --upgrade pip + pip install -e . + + - name: Test ChatProto + run: | + cd ${{ github.workspace }} + python -m unittest discover ChatProto/tests + + - name: Build ChatProto + run: | + cd ${{ github.workspace }} + pip install build + python -m build + + - name: Release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: true + files: | + dist/*.tar.gz + dist/*.whl \ No newline at end of file