-
-
Notifications
You must be signed in to change notification settings - Fork 74
121 lines (105 loc) · 4.54 KB
/
build.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Build Windows Executable
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*'
jobs:
build:
name: Build exe with launcher
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
name: Checkout code
with:
fetch-depth: 0 # Important: fetch all history for all tags and branches
- name: Get Changes between Tags
id: changes
uses: simbo/changes-between-tags-action@v1
with:
validate-tag: false
- name: Get tag name
id: tagName
uses: olegtarasov/get-tag@v2.1.3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11' # Use the version of Python you need
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build Executable
run: |
echo "tag: ${{ steps.changes.outputs.tag }}"
echo "changes: ${{ steps.changes.outputs.changes }}"
python -m ok.update.package_launcher ${{ steps.tagName.outputs.tag }}
python -m ok.update.gen_md5 .\dist
Copy-Item -Path "dist" -Destination "ok-ww" -Recurse
7z a -t7z -r "ok-ww-release-${{ steps.tagName.outputs.tag }}.7z" "ok-ww"
7z a -tzip -r "ok-ww-${{ steps.tagName.outputs.tag }}.zip" "ok-ww"
Remove-Item -Path "ok-ww" -Recurse -Force
python -m ok.update.package_full_with_profile ${{ steps.tagName.outputs.tag }} 1
python -m ok.update.gen_md5 .\dist
Copy-Item -Path "dist" -Destination "ok-ww" -Recurse
7z a -t7z -r "ok-ww-CPU-full-${{ steps.tagName.outputs.tag }}.7z" "ok-ww"
Remove-Item -Path "ok-ww" -Recurse -Force
python -m ok.update.package_full_with_profile ${{ steps.tagName.outputs.tag }} 0
python -m ok.update.gen_md5 .\dist
Copy-Item -Path "dist" -Destination "ok-ww" -Recurse
7z a -t7z -r "ok-ww-Nvidia-GPU-full-${{ steps.tagName.outputs.tag }}.7z" "ok-ww"
Remove-Item -Path "ok-ww" -Recurse -Force
shell: pwsh
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
ok-ww-Nvidia-GPU-full GPU完整版, 需要英伟达RTX2000显卡以上或部分10显卡, 最新显卡驱动, 不需要再下载依赖,
ok-ww-CPU-full CPU完整版, 不需要再下载依赖,
ok-ww-release 无依赖版, 安装后需要下载依赖
ok-ww.zip zip压缩版, 无法解压7z的可以下载
更新内容:
${{ steps.changes.outputs.changes }}
draft: false
prerelease: true
- name: upload-7z
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ok-ww-release-${{ steps.tagName.outputs.tag }}.7z
asset_name: ok-ww-release-${{ steps.tagName.outputs.tag }}.7z
asset_content_type: application/x-7z-compressed
- name: upload-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ok-ww-${{ steps.tagName.outputs.tag }}.zip
asset_name: ok-ww-${{ steps.tagName.outputs.tag }}.zip
asset_content_type: application/zip
- name: upload-7z-gpu
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ok-ww-Nvidia-GPU-full-${{ steps.tagName.outputs.tag }}.7z
asset_name: ok-ww-Nvidia-GPU-full-${{ steps.tagName.outputs.tag }}.7z
asset_content_type: application/x-7z-compressed
- name: upload-7z-cpu
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ok-ww-CPU-full-${{ steps.tagName.outputs.tag }}.7z
asset_name: ok-ww-CPU-full-${{ steps.tagName.outputs.tag }}.7z
asset_content_type: application/x-7z-compressed