diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..ddb8622 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,47 @@ +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + labels: + - 'chore' + - 'documentation' +autolabeler: + - label: 'chore' + files: + - '*.md' + branch: + - '/docs{0,1}\/.+/' + - label: 'bug' + branch: + - '/fix\/.+/' + title: + - '/fix/i' + - label: 'enhancement' + branch: + - '/feature\/.+/' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: + - 'major' + minor: + labels: + - 'minor' + patch: + labels: + - 'patch' + default: patch +template: | + ## Changes + + $CHANGES diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..abef289 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI +on: + push: + branches: + - main + pull_request: + merge_group: + +permissions: write-all + +jobs: + test: + runs-on: ${{ matrix.os }} + name: test (Python ${{ matrix.python-version }} on ${{ matrix.os-label }}) + strategy: + fail-fast: false + matrix: + python-version: [ "3.11", "3.12" ] + os: [ "ubuntu-latest" ] + os-label: [ "Ubuntu" ] + include: + - { python-version: "3.11", os: "windows-latest", os-label: "Windows" } + - { python-version: "3.11", os: "macos-latest", os-label: "macOS" } + - { python-version: "3.11", os: "ubuntu-22.04", os-label: "Ubuntu" } + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "${{ matrix.python-version }}" + - name: Install Dependencies + run: | + pip install uv + uv sync + - name: Build + run: | + uv build + - name: Check + run: | + uvx ruff check src/coze_mcp_server + uvx ruff format --check + uvx mypy . + + test_success: + # this aggregates success state of all jobs listed in `needs` + # this is the only required check to pass CI + name: "Test success" + if: always() + runs-on: ubuntu-latest + needs: [ test ] + steps: + - name: "Success" + if: needs.test.result == 'success' + run: true + shell: bash + - name: "Failure" + if: needs.test.result != 'success' + run: false + shell: bash + + draft: + runs-on: ubuntu-latest + needs: test_success + if: github.ref == 'refs/heads/main' + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000..2068189 --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,13 @@ +name: Publish to PyPI +on: + push: + tags: ["v*.*.*"] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v2.0 + with: + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/required-labels.yml b/.github/workflows/required-labels.yml new file mode 100644 index 0000000..c0329e0 --- /dev/null +++ b/.github/workflows/required-labels.yml @@ -0,0 +1,25 @@ +name: Required Labels +on: + pull_request: + types: [opened, labeled, unlabeled, synchronize] +jobs: + label: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: mheap/github-action-required-labels@v5 + with: + mode: minimum + count: 1 + labels: | + feature + enhancement + fix + bugfix + bug + chore + documentation + add_comment: true + message: "Requires label: feature, enhancement, fix, bugfix, bug, chore, documentation." \ No newline at end of file