Skip to content

Commit c41ac88

Browse files
authored
chore: Update ci config
1 parent 5604618 commit c41ac88

File tree

4 files changed

+153
-0
lines changed

4 files changed

+153
-0
lines changed

.github/release-drafter.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
labels:
6+
- 'feature'
7+
- 'enhancement'
8+
- title: '🐛 Bug Fixes'
9+
labels:
10+
- 'fix'
11+
- 'bugfix'
12+
- 'bug'
13+
- title: '🧰 Maintenance'
14+
labels:
15+
- 'chore'
16+
- 'documentation'
17+
autolabeler:
18+
- label: 'chore'
19+
files:
20+
- '*.md'
21+
branch:
22+
- '/docs{0,1}\/.+/'
23+
- label: 'bug'
24+
branch:
25+
- '/fix\/.+/'
26+
title:
27+
- '/fix/i'
28+
- label: 'enhancement'
29+
branch:
30+
- '/feature\/.+/'
31+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
32+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
33+
version-resolver:
34+
major:
35+
labels:
36+
- 'major'
37+
minor:
38+
labels:
39+
- 'minor'
40+
patch:
41+
labels:
42+
- 'patch'
43+
default: patch
44+
template: |
45+
## Changes
46+
47+
$CHANGES

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
merge_group:
8+
9+
permissions: write-all
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
name: test (Python ${{ matrix.python-version }} on ${{ matrix.os-label }})
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: [ "3.11", "3.12" ]
19+
os: [ "ubuntu-latest" ]
20+
os-label: [ "Ubuntu" ]
21+
include:
22+
- { python-version: "3.11", os: "windows-latest", os-label: "Windows" }
23+
- { python-version: "3.11", os: "macos-latest", os-label: "macOS" }
24+
- { python-version: "3.11", os: "ubuntu-22.04", os-label: "Ubuntu" }
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Set up Python
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: "${{ matrix.python-version }}"
31+
- name: Install Dependencies
32+
run: |
33+
pip install uv
34+
uv sync
35+
- name: Build
36+
run: |
37+
uv build
38+
- name: Check
39+
run: |
40+
uvx ruff check src/coze_mcp_server
41+
uvx ruff format --check
42+
uvx mypy .
43+
44+
test_success:
45+
# this aggregates success state of all jobs listed in `needs`
46+
# this is the only required check to pass CI
47+
name: "Test success"
48+
if: always()
49+
runs-on: ubuntu-latest
50+
needs: [ test ]
51+
steps:
52+
- name: "Success"
53+
if: needs.test.result == 'success'
54+
run: true
55+
shell: bash
56+
- name: "Failure"
57+
if: needs.test.result != 'success'
58+
run: false
59+
shell: bash
60+
61+
draft:
62+
runs-on: ubuntu-latest
63+
needs: test_success
64+
if: github.ref == 'refs/heads/main'
65+
steps:
66+
- uses: release-drafter/release-drafter@v5
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pypi-release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Publish to PyPI
2+
on:
3+
push:
4+
tags: ["v*.*.*"]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Build and publish to pypi
11+
uses: JRubics/poetry-publish@v2.0
12+
with:
13+
pypi_token: ${{ secrets.PYPI_TOKEN }}

.github/workflows/required-labels.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Required Labels
2+
on:
3+
pull_request:
4+
types: [opened, labeled, unlabeled, synchronize]
5+
jobs:
6+
label:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
steps:
12+
- uses: mheap/github-action-required-labels@v5
13+
with:
14+
mode: minimum
15+
count: 1
16+
labels: |
17+
feature
18+
enhancement
19+
fix
20+
bugfix
21+
bug
22+
chore
23+
documentation
24+
add_comment: true
25+
message: "Requires label: feature, enhancement, fix, bugfix, bug, chore, documentation."

0 commit comments

Comments
 (0)