Skip to content

chore(release): bump version to 7.10.0 #347

chore(release): bump version to 7.10.0

chore(release): bump version to 7.10.0 #347

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
target:
description: '选择要构建的目标平台'
required: true
default: 'all'
type: choice
options:
- all
- win-cli
- win-desktop
- linux-x64
- linux-arm64
- macos-arm64
- macos-desktop-arm64
jobs:
build-and-release:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: |
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
npm install
cd src/webui/FE
npm install
- name: Build
run: |
npm run build
npm run build-webui
- name: Compress dist
run: |
sudo apt install zip -y
cd ./dist/
zip -r ../LLBot.zip ./*
- name: Compress for Windows Cli
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == 'win-cli' || startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir llbot-cli-win-x64
cd llbot-cli-win-x64
mkdir -p bin/llbot
cp ../dist/使用说明.txt ./
cp ../dist/更新日志.txt ./
cp -r ../dist/* bin/llbot/
wget https://github.com/linyuchen/PMHQ/releases/latest/download/pmhq-win-x64.zip
unzip pmhq-win-x64.zip
mkdir -p bin/pmhq
rm pmhq-win-x64.zip
mv pmhq-win-x64.exe bin/pmhq/pmhq.exe
mv pmhq.dll bin/pmhq/
wget https://github.com/LLOneBot/LuckyLillia.CLI/releases/latest/download/llbot-win-x64.exe
mv llbot-win-x64.exe llbot.exe
wget https://github.com/LLOneBot/exe/releases/latest/download/node.exe -O bin/llbot/node.exe
wget https://github.com/LLOneBot/exe/releases/latest/download/ffmpeg.exe -O bin/llbot/ffmpeg.exe
wget https://github.com/LLOneBot/exe/releases/latest/download/ffprobe.exe -O bin/llbot/ffprobe.exe
zip -r ../LLBot-CLI-win-x64.zip ./*
- name: Compress for Windows Desktop
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == 'win-desktop' || startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir llbot-desktop-win-x64
cd llbot-desktop-win-x64
mkdir -p bin/llbot
cp ../dist/使用说明.txt ./
cp ../dist/更新日志.txt ./
cp -r ../dist/* ./bin/llbot/
wget https://github.com/LLOneBot/LuckyLilliaDesktop.Avalonia/releases/latest/download/lucky-lillia-desktop-win-x64.zip
unzip lucky-lillia-desktop-win-x64.zip
rm lucky-lillia-desktop-win-x64.zip
mv lucky-lillia-desktop.exe llbot.exe
zip -r ../LLBot-Desktop-win-x64.zip ./*
- name: Compress for Linux CLI x64
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == 'linux-x64' || startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir llbot-cli-linux-x64
cd llbot-cli-linux-x64
mkdir -p bin/llbot
mkdir -p bin/pmhq
cp ../doc/使用说明-linux-cli.txt ./使用说明.txt
cp ../dist/更新日志.txt ./
cp -r ../dist/* ./bin/llbot/
wget https://github.com/linyuchen/PMHQ/releases/latest/download/pmhq-linux-x64.zip
unzip pmhq-linux-x64.zip
rm pmhq-linux-x64.zip
mv pmhq-linux-x64 bin/pmhq/pmhq
mv libpmhq.so bin/pmhq/
wget https://github.com/LLOneBot/exe/releases/latest/download/node-linux-x64 -O bin/llbot/node
wget https://github.com/LLOneBot/LuckyLillia.CLI/releases/latest/download/llbot-linux-x64 -O llbot
cp ../script/start-linux.sh ./start.sh
zip -r ../LLBot-CLI-linux-x64.zip ./*
- name: Compress for Linux CLI arm64
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == 'linux-arm64' || startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir llbot-cli-linux-arm64
cd llbot-cli-linux-arm64
mkdir -p bin/llbot
mkdir -p bin/pmhq
cp ../doc/使用说明-linux-cli.txt ./使用说明.txt
cp ../dist/更新日志.txt ./
cp -r ../dist/* ./bin/llbot/
wget https://github.com/linyuchen/PMHQ/releases/latest/download/pmhq-linux-arm64.zip
unzip pmhq-linux-arm64.zip
rm pmhq-linux-arm64.zip
mv pmhq-linux-arm64 bin/pmhq/pmhq
mv libpmhq.so bin/pmhq/
wget https://github.com/LLOneBot/exe/releases/latest/download/node-linux-arm64 -O bin/llbot/node
wget https://github.com/LLOneBot/LuckyLillia.CLI/releases/latest/download/llbot-linux-arm64 -O llbot
cp ../script/start-linux.sh ./start.sh
zip -r ../LLBot-CLI-linux-arm64.zip ./*
- name: Compress for macOS CLI arm64
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == 'macos-arm64' || startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir llbot-cli-macos-arm64
cd llbot-cli-macos-arm64
mkdir -p bin/llbot
mkdir -p bin/pmhq
cp ../doc/使用说明-macos-cli.txt ./使用说明.txt
cp ../script/start-mac.sh ./start.sh
cp ../dist/更新日志.txt ./
cp -r ../dist/* ./bin/llbot/
wget https://github.com/linyuchen/PMHQ/releases/latest/download/pmhq-macos-arm64.zip
unzip pmhq-macos-arm64.zip
rm pmhq-macos-arm64.zip
mv pmhq-macos-arm64 bin/pmhq/pmhq
mv libpmhq.dylib bin/pmhq/
wget https://github.com/LLOneBot/exe/releases/latest/download/node-darwin-arm64 -O bin/llbot/node
wget https://github.com/LLOneBot/LuckyLillia.CLI/releases/latest/download/llbot-macos-arm64 -O llbot
wget https://github.com/LLOneBot/exe/releases/download/0.0.0/QQ-macos.zip
unzip QQ-macos.zip -d bin/qq
rm QQ-macos.zip
tar -cJvf ../LLBot-CLI-macos-arm64.tar.xz ./*
- name: Compress for macOS Desktop arm64
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == 'macos-desktop-arm64' || startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir llbot-desktop-macos-arm64
cd llbot-desktop-macos-arm64
mkdir -p bin/llbot
cp ../doc/使用说明.txt ./使用说明.txt
cp ../dist/更新日志.txt ./
cp -r ../dist/* ./bin/llbot/
wget https://github.com/LLOneBot/LuckyLilliaDesktop.Avalonia/releases/latest/download/lucky-lillia-desktop-macos-arm64.tar.gz
tar -xzvf lucky-lillia-desktop-macos-arm64.tar.gz
rm lucky-lillia-desktop-macos-arm64.tar.gz
tar -cJvf ../LLBot-Desktop-macos-arm64.tar.xz ./*
- name: Compress for Docker
run: |
cp script/install-llbot-docker.sh LLBot-Docker.sh
# 手动触发时只上传 artifacts
- name: Upload LLBot.zip
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: LLBot
path: LLBot.zip
retention-days: 30
- name: Upload LLBot-Desktop-win-x64.zip
if: ${{ !startsWith(github.ref, 'refs/tags/') && (github.event.inputs.target == 'all' || github.event.inputs.target == 'win-desktop') }}
uses: actions/upload-artifact@v4
with:
name: LLBot-Desktop-win-x64
path: LLBot-Desktop-win-x64.zip
retention-days: 30
- name: Upload LLBot-CLI-win-x64.zip
if: ${{ !startsWith(github.ref, 'refs/tags/') && (github.event.inputs.target == 'all' || github.event.inputs.target == 'win-cli') }}
uses: actions/upload-artifact@v4
with:
name: LLBot-CLI-win-x64
path: LLBot-CLI-win-x64.zip
retention-days: 30
- name: Upload LLBot-CLI-linux-x64.zip
if: ${{ !startsWith(github.ref, 'refs/tags/') && (github.event.inputs.target == 'all' || github.event.inputs.target == 'linux-x64') }}
uses: actions/upload-artifact@v4
with:
name: LLBot-CLI-linux-x64
path: LLBot-CLI-linux-x64.zip
retention-days: 30
- name: Upload LLBot-CLI-linux-arm64.zip
if: ${{ !startsWith(github.ref, 'refs/tags/') && (github.event.inputs.target == 'all' || github.event.inputs.target == 'linux-arm64') }}
uses: actions/upload-artifact@v4
with:
name: LLBot-CLI-linux-arm64
path: LLBot-CLI-linux-arm64.zip
retention-days: 30
- name: Upload LLBot-CLI-macos-arm64.tar.xz
if: ${{ !startsWith(github.ref, 'refs/tags/') && (github.event.inputs.target == 'all' || github.event.inputs.target == 'macos-arm64') }}
uses: actions/upload-artifact@v4
with:
name: LLBot-CLI-macos-arm64
path: LLBot-CLI-macos-arm64.tar.xz
retention-days: 30
- name: Upload LLBot-Desktop-macos-arm64.tar.xz
if: ${{ !startsWith(github.ref, 'refs/tags/') && (github.event.inputs.target == 'all' || github.event.inputs.target == 'macos-desktop-arm64') }}
uses: actions/upload-artifact@v4
with:
name: LLBot-Desktop-macos-arm64
path: LLBot-Desktop-macos-arm64.tar.xz
retention-days: 30
- name: Upload LLBot-Docker.sh
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v4
with:
name: LLBot-Docker
path: LLBot-Docker.sh
retention-days: 30
# tag 触发时创建 release
- name: Extract version from tag
if: startsWith(github.ref, 'refs/tags/')
id: get-version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
- name: Generate release body from changelog
if: startsWith(github.ref, 'refs/tags/')
id: changelog
run: |
# 取第一个分段
content="$(awk 'BEGIN{RS="=================";ORS=""} NR==1{print}' doc/更新日志.txt)"
# 去掉前两行
body="$(echo "$content" | tail -n +3)"
# 去除前后空白
body="$(echo "$body" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
# 输出到 GITHUB_OUTPUT
echo "BODY<<EOF" >> $GITHUB_OUTPUT
echo "$body" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: 'LLBot.zip, LLBot-Desktop-win-x64.zip, LLBot-Desktop-macos-arm64.tar.xz, LLBot-CLI-win-x64.zip, LLBot-CLI-linux-x64.zip, LLBot-CLI-linux-arm64.zip, LLBot-CLI-macos-arm64.tar.xz, LLBot-Docker.sh'
draft: true
token: ${{ secrets.RELEASE_TOKEN }}
name: LuckyLilliaBot v${{ steps.get-version.outputs.VERSION }}
body: |
${{ steps.changelog.outputs.BODY }}
**Windows Desktop 版本只支持 Windows Server 2012 R2 / Windows 10 及以上版本**
- name: Publish to npm
if: startsWith(github.ref, 'refs/tags/')
run: |
npm install -g npm@latest
mv dist package
tar -czf llonebot-dist.tgz package/*
npm publish llonebot-dist.tgz --provenance