forked from LLOneBot/LuckyLilliaBot
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (72 loc) · 2.55 KB
/
publish.yml
File metadata and controls
80 lines (72 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- 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: |
mkdir llonebot-win-x64
sudo apt install zip -y
cd ./dist/
mv 使用说明.txt ../llonebot-win-x64/
zip -r ../LLOneBot.zip ./*
- name: Compress for Windows
run: |
cd llonebot-win-x64
mv ../dist/更新日志.txt ./
mv ../dist ./llonebot
wget https://github.com/linyuchen/PMHQ/releases/latest/download/pmhq-win-x64.zip
unzip pmhq-win-x64.zip
rm pmhq-win-x64.zip
mv pmhq-win-x64.exe llonebot.exe
wget https://github.com/LLOneBot/exe/releases/latest/download/node.exe -O llonebot/node.exe
zip -r ../LLOneBot-win-x64.zip ./*
wget https://github.com/LLOneBot/exe/releases/latest/download/ffmpeg.exe -O llonebot/ffmpeg.exe
wget https://github.com/LLOneBot/exe/releases/latest/download/ffprobe.exe -O llonebot/ffprobe.exe
zip -r ../LLOneBot-win-x64-ffmpeg.zip ./*
- name: Extract version from tag
id: get-version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
- name: Generate release body from changelog
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
uses: ncipollo/release-action@v1
with:
artifacts: 'LLOneBot.zip, LLOneBot-win-x64.zip, LLOneBot-win-x64-ffmpeg.zip'
draft: true
token: ${{ secrets.RELEASE_TOKEN }}
name: LLOneBot v${{ steps.get-version.outputs.VERSION }}
body: |
${{ steps.changelog.outputs.BODY }}