chore: remove obsolete GitHub workflows and update documentation commands
Some checks failed
Test / test (push) Failing after 11m14s
Some checks failed
Test / test (push) Failing after 11m14s
This commit is contained in:
33
.github/workflows/build.yml
vendored
33
.github/workflows/build.yml
vendored
@@ -1,33 +0,0 @@
|
||||
name: 发布扩展
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 配置 uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: 运行测试
|
||||
run: uv run --frozen pytest
|
||||
|
||||
- name: 构建扩展
|
||||
run: uv run --frozen pack
|
||||
|
||||
- name: 发布扩展包
|
||||
uses: https://gitea.com/actions/gitea-release-action@v1.3.6
|
||||
with:
|
||||
files: |-
|
||||
dist/*.zip
|
||||
54
.github/workflows/docs.yml
vendored
54
.github/workflows/docs.yml
vendored
@@ -1,54 +0,0 @@
|
||||
name: 构建并部署文档
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- docs/**
|
||||
- mkdocs.yml
|
||||
- .github/workflows/docs.yml
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 配置 uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
|
||||
- name: 构建文档
|
||||
run: uv run --frozen --only-group docs mkdocs build --strict --site-dir site
|
||||
|
||||
- name: 整理发布目录
|
||||
run: |
|
||||
mkdir -p public/anyimage
|
||||
cp -a site/. public/anyimage/
|
||||
|
||||
- name: 配置 Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "24"
|
||||
|
||||
- name: 部署到 Cloudflare Workers
|
||||
env:
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_WORKER_NAME: ${{ vars.CLOUDFLARE_WORKER_NAME }}
|
||||
run: |
|
||||
test -n "$CLOUDFLARE_ACCOUNT_ID"
|
||||
test -n "$CLOUDFLARE_API_TOKEN"
|
||||
test -n "$CLOUDFLARE_WORKER_NAME"
|
||||
npx --yes wrangler@4 deploy \
|
||||
--assets ./public \
|
||||
--name "$CLOUDFLARE_WORKER_NAME" \
|
||||
--compatibility-date 2026-08-19 \
|
||||
--keep-vars \
|
||||
--message "AnyImage docs $GITHUB_SHA" \
|
||||
--autoconfig=false
|
||||
70
.github/workflows/release.yml
vendored
Normal file
70
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
# Publish on any tag starting with a `v`, e.g., v1.0.1
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
check_version:
|
||||
name: Check Version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.read_version.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Check tag matches project version
|
||||
id: read_version
|
||||
run: |
|
||||
version="$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")"
|
||||
if [ "v$version" != "$GITHUB_REF_NAME" ]; then
|
||||
echo "Tag $GITHUB_REF_NAME does not match pyproject.toml version $version" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build_extensions:
|
||||
name: Build Extensions
|
||||
needs: check_version
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest
|
||||
|
||||
- name: Pack extensions
|
||||
run: uv run pack
|
||||
|
||||
- name: Check extension archives
|
||||
run: |
|
||||
for platform in windows-x64 macos-arm64 linux-x64; do
|
||||
archive="dist/AnyImage.v${{ needs.check_version.outputs.version }}.${platform}.zip"
|
||||
if [ ! -f "$archive" ]; then
|
||||
echo "Missing archive: $archive" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Publish release
|
||||
uses: https://gitea.com/actions/gitea-release-action@v1.3.6
|
||||
with:
|
||||
files: |-
|
||||
dist/*.zip
|
||||
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: 运行测试
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -14,13 +14,13 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 检出代码
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 配置 uv
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: 运行测试
|
||||
run: uv run --frozen pytest
|
||||
- name: Run tests
|
||||
run: uv run pytest
|
||||
|
||||
Reference in New Issue
Block a user