mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2025-10-04 18:46:30 +00:00
🚀 v7
This commit is contained in:
43
.github/workflows/build-image.yml
vendored
43
.github/workflows/build-image.yml
vendored
@@ -1,43 +0,0 @@
|
||||
|
||||
name: Docker Image Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: docker-build
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME }}
|
||||
password: ${{ secrets.GHCR_PASSWORD }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ghcr.io/liteyukistudio/liteyukibot:latest
|
||||
|
||||
- name: Log out from GitHub Container Registry
|
||||
run: docker logout ghcr.io
|
66
.github/workflows/deploy-docs-liteyukicloud.yml
vendored
66
.github/workflows/deploy-docs-liteyukicloud.yml
vendored
@@ -1,66 +0,0 @@
|
||||
name: Deploy VitePress site to Liteyuki PaaS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: write
|
||||
statuses: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
MELI_SITE: "800a7c09-dd9c-4ba7-a43f-af9bc69808c4"
|
||||
|
||||
jobs:
|
||||
# 构建工作
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Setup API markdown
|
||||
run: |-
|
||||
python -m pip install litedoc
|
||||
litedoc liteyuki -o docs/zh/dev/api -l zh-Hans -cd class -fd func -md func -vd var -bu https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/
|
||||
litedoc liteyuki -o docs/en/dev/api -l en -cd class -fd func -md func -vd var -bu https://github.com/LiteyukiStudio/LiteyukiBot/tree/main/liteyuki/
|
||||
|
||||
- name: 安装 pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
run_install: true
|
||||
version: 8
|
||||
|
||||
- name: 设置 Node.js
|
||||
run: |-
|
||||
cd docs
|
||||
pnpm install
|
||||
|
||||
- name: 构建文档
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=8192
|
||||
run: |-
|
||||
cd docs
|
||||
pnpm run docs:build
|
||||
> .vitepress/dist/.nojekyll
|
||||
|
||||
- name: "发布"
|
||||
run: |
|
||||
npx -p "@getmeli/cli" meli upload docs/.vitepress/dist \
|
||||
--url "https://pages.liteyuki.icu" \
|
||||
--site "$MELI_SITE" \
|
||||
--token "$MELI_TOKEN" \
|
||||
--release "$GITHUB_SHA"
|
||||
env:
|
||||
MELI_TOKEN: ${{ secrets.MELI_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
51
.github/workflows/issue_handler.yml
vendored
51
.github/workflows/issue_handler.yml
vendored
@@ -1,51 +0,0 @@
|
||||
name: Issue Handler
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [ opened, edited, closed ]
|
||||
|
||||
concurrency:
|
||||
group: issue_handler
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
check-issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check issue title
|
||||
id: check_title
|
||||
run: |
|
||||
ISSUE_TITLE="${{ github.event.issue.title }}"
|
||||
if [[ "$ISSUE_TITLE" == Plugin:* || "$ISSUE_TITLE" == Resource:* ]]; then
|
||||
echo "Title starts with Plugin: or Resource:."
|
||||
echo "::set-output name=title_match::true"
|
||||
else
|
||||
echo "Title does not start with Plugin: or Resource:."
|
||||
echo "::set-output name=title_match::false"
|
||||
fi
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
if: steps.check_title.outputs.title_match == 'true'
|
||||
with:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.check_title.outputs.title_match == 'true'
|
||||
run: |
|
||||
echo "Installing dependencies."
|
||||
pip install -r liteyuki_flow/requirements.txt
|
||||
|
||||
- name: Run Plugin/Resource issue handler
|
||||
if: steps.check_title.outputs.title_match == 'true'
|
||||
run: |
|
||||
echo "Running Plugin/Resource issue handler."
|
||||
python -m liteyuki_flow --handle
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||
REPOSITORY: ${{ github.repository }}
|
||||
ACT_TYPE: ${{ github.event.action }}
|
30
.github/workflows/pre-commit.yml
vendored
30
.github/workflows/pre-commit.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Pre-commit checks
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13'] # 添加你想要测试的 Python 版本
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }} # 使用矩阵中的 Python 版本
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install pdm
|
||||
python -m pip install pre-commit
|
||||
pdm config python.use_venv false
|
||||
pdm install --no-lock
|
||||
pre-commit install
|
||||
|
||||
- name: Run pre-commit
|
||||
run: pre-commit run --all-files
|
21
.github/workflows/pypi-publish.yml
vendored
21
.github/workflows/pypi-publish.yml
vendored
@@ -1,21 +0,0 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
pypi-publish:
|
||||
name: upload release to PyPI
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: pdm-project/setup-pdm@v3
|
||||
|
||||
- name: Publish package distributions to PyPI
|
||||
run: pdm publish
|
Reference in New Issue
Block a user