Skip to content

chore: Update ci config #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
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
47 changes: 47 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}
13 changes: 13 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
25 changes: 25 additions & 0 deletions .github/workflows/required-labels.yml
Original file line number Diff line number Diff line change
@@ -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."