forked from xfgryujk/blivechat
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 1.86 KB
/
windows.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
name: Build and Release EXE
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H-%M-%S')"
- name: Create tag
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.date.outputs.date }}',
sha: context.sha
})
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12' # 替换为你的 Python 版本
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Setup NodeJS
uses: actions/[email protected]
with:
node-version: '20.14.0'
- name: Build Frontend
run: |
cd frontend
npm i
npm run build
cd ..
- name: Build EXE
run: |
pyinstaller main.spec
# - name: Tree File Structure
# id: tree
# run: tree /F
- name: Zip Files
uses: vimtor/[email protected]
with:
files: dist/main
dest: blivechat.zip
- name: Upload EXE to GitHub Release
uses: softprops/action-gh-release@v1
with:
files: blivechat.zip # 假设生成的EXE文件在dist目录下
tag_name: ${{ steps.date.outputs.date }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}