mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-04 06:31:13 +00:00
The workflow now copies openapi.json from the dist directory instead of the package root, ensuring the built schema is used during the release process.
153 lines
6.9 KiB
YAML
153 lines
6.9 KiB
YAML
name: Auto Release Docker
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
publish-schema:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- name: Get Version
|
|
id: get_version
|
|
run: |
|
|
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
|
|
version=${latest_tag#v}
|
|
echo "version=${version}" >> $GITHUB_ENV
|
|
echo "latest_tag=${latest_tag}" >> $GITHUB_ENV
|
|
echo "Debug: Version is ${version}"
|
|
|
|
- name: Install Dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build napcat-schema
|
|
run: |
|
|
cd packages/napcat-schema
|
|
pnpm run build:openapi
|
|
|
|
- name: Checkout NapCatDocs
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: NapNeko/NapCatDocs
|
|
token: ${{ secrets.NAPCAT_BUILD }}
|
|
path: napcat-docs
|
|
|
|
- name: Copy OpenAPI Schema
|
|
run: |
|
|
mkdir -p napcat-docs/src/api/${{ env.version }}
|
|
cp packages/napcat-schema/dist/openapi.json napcat-docs/src/api/${{ env.version }}/openapi.json
|
|
echo "OpenAPI schema copied to napcat-docs/src/api/${{ env.version }}/openapi.json"
|
|
|
|
- name: Commit and Push
|
|
run: |
|
|
cd napcat-docs
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git add src/api/${{ env.version }}/openapi.json
|
|
git commit -m "chore: update OpenAPI schema for version ${{ env.version }}" || echo "No changes to commit"
|
|
git push
|
|
|
|
shell-docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Trigger NapCat-Docker docker-publish workflow
|
|
env:
|
|
GH_TOKEN: ${{ secrets.NAPCAT_BUILD }}
|
|
run: |
|
|
curl -X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: Bearer $GH_TOKEN" \
|
|
https://api.github.com/repos/NapNeko/NapCat-Docker/actions/workflows/docker-publish.yml/dispatches \
|
|
-d '{"ref":"main"}'
|
|
framework-docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Trigger NapCat-Framework-Docker docker-publish workflow
|
|
env:
|
|
GH_TOKEN: ${{ secrets.NAPCAT_BUILD }}
|
|
run: |
|
|
curl -X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: Bearer $GH_TOKEN" \
|
|
https://api.github.com/repos/NapNeko/NapCat.Docker.Framework/actions/workflows/docker-image.yml/dispatches \
|
|
-d '{"ref":"main"}'
|
|
appimage-shell-docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
- name: Get Latest NapCat Version
|
|
id: get_version
|
|
run: |
|
|
# 获取当前仓库的最新 tag
|
|
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
|
|
# 输出调试信息
|
|
echo "Debug: Latest NapCat Version is ${latest_tag}"
|
|
echo "latest_tag=${latest_tag}" >> $GITHUB_ENV
|
|
- name: Trigger Release NapCat AppImage Workflow
|
|
env:
|
|
GH_TOKEN: ${{ secrets.NAPCAT_BUILD }}
|
|
NAPCAT_VERSION: ${{ env.latest_tag }}
|
|
QQ_VERSION_X86_64: 'https://dldir1v6.qq.com/qqfile/qq/QQNT/94704804/linuxqq_3.2.23-44343_x86_64.AppImage' # 写死 QQ 版本
|
|
QQ_VERSION_ARM64: 'https://dldir1v6.qq.com/qqfile/qq/QQNT/94704804/linuxqq_3.2.23-44343_arm64.AppImage' # 写死 QQ 版本
|
|
run: |
|
|
echo "Debug: Triggering Release NapCat AppImage with napcat_version=${NAPCAT_VERSION}, qq_version_x86_64=${QQ_VERSION_X86_64}, qq_version_arm64=${QQ_VERSION_ARM64}"
|
|
curl -X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: Bearer $GH_TOKEN" \
|
|
https://api.github.com/repos/NapNeko/NapCatAppImageBuild/actions/workflows/release.yml/dispatches \
|
|
-d "{\"ref\":\"main\",\"inputs\":{\"napcat_version\":\"${NAPCAT_VERSION}\",\"qq_version_x86_64\":\"${QQ_VERSION_X86_64}\",\"qq_version_arm64\":\"${QQ_VERSION_ARM64}\"}}"
|
|
node-shell-docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
- name: Get Latest NapCat Version
|
|
id: get_version
|
|
run: |
|
|
# 获取当前仓库的最新 tag
|
|
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
|
|
# 输出调试信息
|
|
echo "Debug: Latest NapCat Version is ${latest_tag}"
|
|
echo "latest_tag=${latest_tag}" >> $GITHUB_ENV
|
|
- name: Trigger Release NapCat AppImage Workflow
|
|
env:
|
|
GH_TOKEN: ${{ secrets.NAPCAT_BUILD }}
|
|
NAPCAT_VERSION: ${{ env.latest_tag }}
|
|
QQ_VERSION_X86_64: 'https://dldir1v6.qq.com/qqfile/qq/QQNT/94704804/linuxqq_3.2.23-44343_x86_64.AppImage' # 写死 QQ 版本
|
|
QQ_VERSION_ARM64: 'https://dldir1v6.qq.com/qqfile/qq/QQNT/94704804/linuxqq_3.2.23-44343_arm64.AppImage' # 写死 QQ 版本
|
|
run: |
|
|
echo "Debug: Triggering Release NapCat AppImage with napcat_version=${NAPCAT_VERSION}, qq_url_amd64=${QQ_VERSION_X86_64}, qq_url_arm64=${QQ_VERSION_ARM64}"
|
|
curl -X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: Bearer $GH_TOKEN" \
|
|
https://api.github.com/repos/NapNeko/NapCatLinuxNodeLoader/actions/workflows/release.yml/dispatches \
|
|
-d "{\"ref\":\"main\",\"inputs\":{\"napcat_version\":\"${NAPCAT_VERSION}\",\"qq_url_amd64\":\"${QQ_VERSION_X86_64}\",\"qq_url_arm64\":\"${QQ_VERSION_ARM64}\"}}"
|
|
- name: Trigger Release NapCat AppImage Workflow
|
|
env:
|
|
GH_TOKEN: ${{ secrets.NAPCAT_BUILD }}
|
|
NAPCAT_VERSION: ${{ env.latest_tag }}
|
|
QQ_VERSION_X86_64: 'https://dldir1v6.qq.com/qqfile/qq/QQNT/94704804/linuxqq_3.2.23-44343_x86_64.AppImage' # 写死 QQ 版本
|
|
QQ_VERSION_ARM64: 'https://dldir1v6.qq.com/qqfile/qq/QQNT/94704804/linuxqq_3.2.23-44343_arm64.AppImage' # 写死 QQ 版本
|
|
run: |
|
|
echo "Debug: Triggering Release NapCat AppImage with napcat_version=${NAPCAT_VERSION}, qq_url_amd64=${QQ_VERSION_X86_64}, qq_url_arm64=${QQ_VERSION_ARM64}"
|
|
curl -X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: Bearer $GH_TOKEN" \
|
|
https://api.github.com/repos/NapNeko/NapCatLinuxNodeLoader/actions/workflows/docker-publish.yml/dispatches \
|
|
-d "{\"ref\":\"main\",\"inputs\":{\"napcat_version\":\"${NAPCAT_VERSION}\",\"qq_url_amd64\":\"${QQ_VERSION_X86_64}\",\"qq_url_arm64\":\"${QQ_VERSION_ARM64}\"}}" |