forked from lss233/chatgpt-mirai-qq-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (83 loc) · 4.73 KB
/
quickstart-windows-mirai.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Windows Quickstart (Mirai)
on:
workflow_dispatch:
push:
tags:
- '**'
jobs:
build:
name: Quickstart
runs-on: Windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate files
run: |
mkdir C:/generated_files
mkdir C:/tmp_files
echo "Creating folders..."
cd C:/generated_files
mkdir mirai
mkdir chatgpt
mkdir ffmpeg
mkdir mirai/plugins
echo "Downloading JRE..."
Invoke-WebRequest -URI https://download.bell-sw.com/java/17.0.6+10/bellsoft-jre17.0.6+10-windows-amd64.zip -OutFile C:/tmp_files/jre.zip
7z x C:/tmp_files/jre.zip -r -oC:/generated_files/mirai/jre/
echo "Downloading mcl..."
Invoke-WebRequest -URI https://github.com/iTXTech/mirai-console-loader/releases/download/v2.1.2/mcl-2.1.2.zip -OutFile C:/tmp_files/mcl.zip
7z x C:/tmp_files/mcl.zip -r -oC:/generated_files/mirai/
cd C:/generated_files/mirai/
$search = [Regex]::Escape('set JAVA_BINARY=java')
$replace = 'set JAVA_BINARY=jre\jre-17.0.6\bin\java.exe'
(Get-Content -Path 'C:/generated_files/mirai/mcl.cmd' -Raw) -replace $search, $replace | Set-Content -Path 'C:/generated_files/mirai/mcl.cmd'
Invoke-WebRequest -URI https://github.com/cssxsh/fix-protocol-version/releases/download/v1.3.0/fix-protocol-version-1.3.0.mirai2.jar -OutFile C:/generated_files/mirai/plugins/fix-protocol-version-1.3.0.mirai2.jar
./mcl.cmd --update-package net.mamoe:mirai-api-http --channel stable-v2 --type plugin
./mcl.cmd --update-package xyz.cssxsh.mirai:mirai-device-generator --channel stable --type plugin
./mcl.cmd --update-package xyz.cssxsh.mirai:fix-protocol-version --channel stable --type plugin
./mcl.cmd --dry-run
cp -r D:\a\chatgpt-mirai-qq-bot\chatgpt-mirai-qq-bot\* C:\generated_files\chatgpt\
echo "Downloading ffmpeg ..."
Invoke-WebRequest https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-6.0-full_build.7z -OutFile C:/tmp_files/ffmpeg.7z
7z x C:/tmp_files/ffmpeg.zip -r -oC:/generated_files/ffmpeg
echo "Downloading Python3.11 ..."
Invoke-WebRequest https://www.python.org/ftp/python/3.11.2/python-3.11.2-embed-amd64.zip -OutFile C:/tmp_files/python.zip
7z x C:/tmp_files/python.zip -r -oC:/generated_files/python3.11
echo "Downloading get-pip.py ..."
Invoke-WebRequest -URI https://bootstrap.pypa.io/get-pip.py -OutFile C:/generated_files/python3.11/get-pip.py
echo "import site" >> C:/generated_files/python3.11/python311._pth
echo "Moving files..."
mv D:\a\chatgpt-mirai-qq-bot\chatgpt-mirai-qq-bot\.github\quickstarts\windows\ C:/generated_files/files/
echo "Replacing..."
cp C:/generated_files/files/mirai/scripts/初始化.cmd C:/generated_files/
Invoke-WebRequest -URI https://github.com/lss233/awesome-chatgpt-qq-presets/archive/refs/heads/master.zip -OutFile C:/tmp_files/presets.zip
7z x C:/tmp_files/presets.zip -oC:/tmp_files/
Copy-Item C:\tmp_files\awesome-chatgpt-qq-presets-master\* -Destination C:\generated_files\chatgpt\presets\ -Recurse
Invoke-WebRequest -URI https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.mxe-cross-win64.7z -O C:/tmp_files/wkhtmltox.7z
echo "Setting up wkhtmltox"
7z x C:/tmp_files/wkhtmltox.7z -oC:/tmp_files/
cp C:/tmp_files/wkhtmltox/bin/wkhtmltoimage.exe C:\generated_files\chatgpt\
echo "Downloading vc_redist.exe..."
Invoke-WebRequest -URI https://aka.ms/vs/17/release/vc_redist.x64.exe -O "C:\generated_files\【语音功能依赖】vc_redist.x64.exe"
echo "Downloading packages..."
cd C:/generated_files/chatgpt
..\python3.11\python.exe C:/generated_files/python3.11/get-pip.py
..\python3.11\python.exe -m pip install -r requirements.txt
echo "Packing..."
cd C:/generated_files
7z a quickstart-windows-mirai-amd64.zip C:\generated_files\*
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: quickstart-windows-mirai-amd64.zip
path: |
C:\generated_files\quickstart-windows-mirai-amd64.zip
- name: Upload compressed files to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: C:\generated_files\quickstart-windows-mirai-amd64.zip
asset_name: Windows-quickstart-${{ github.ref }}.zip
tag: ${{ github.ref }}
overwrite: true
body: "quickstart-windows-amd64.zip 是为 Windows x64 用户准备的快速启动包"