-
Notifications
You must be signed in to change notification settings - Fork 79
executable file
·60 lines (58 loc) · 2.14 KB
/
[server]Compile with PyInstaller.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
name: server_Compile with PyInstaller
on:
release:
types: [created]
jobs:
build:
runs-on: windows-latest
defaults:
run:
working-directory: ./YuYuWechatV2_Server
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Compile with PyInstaller
run: |
pip install pyinstaller
pyinstaller YuYuWechatV2_Server.spec
- name: Run bat file and test
id: run_test
run: |
Start-Process -FilePath "D:\a\YuYuWechat\YuYuWechat\YuYuWechatV2_Server\dist\YuYuWechatV2_Server_run.bat" -NoNewWindow
Start-Sleep -Seconds 10 # 等待服务器启动
$response = Invoke-RestMethod -Uri http://127.0.0.1:8000/wechat/ping/ -UseBasicParsing
Write-Output "Response: $response"
if ($response.status -eq "pong") {
Write-Output "Test passed"
echo "test_passed=true" >> $env:GITHUB_ENV
} else {
Write-Output "Test failed"
exit 1
}
- name: Upload release exe
if: env.test_passed == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: D:\a\YuYuWechat\YuYuWechat\YuYuWechatV2_Server\dist\YuYuWechatV2_Server.exe
asset_name: YuYuWechatV2_Server.exe
asset_content_type: application/octet-stream
- name: Upload release bat
if: env.test_passed == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: D:\a\YuYuWechat\YuYuWechat\YuYuWechatV2_Server\dist\YuYuWechatV2_Server_run.bat
asset_name: YuYuWechatV2_Server_run.bat
asset_content_type: application/octet-stream