-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (75 loc) · 2.49 KB
/
Copy pathrelease.yml
File metadata and controls
87 lines (75 loc) · 2.49 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
81
82
83
84
85
86
87
name: Build & Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
prerelease:
description: '标记为预发布'
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout frontend
uses: actions/checkout@v4
- name: Determine version
id: version
shell: pwsh
run: |
if ("${{ github.ref_type }}" -eq "tag") {
$ver = "${{ github.ref_name }}" -replace '^v', ''
} else {
$pkg = Get-Content package.json | ConvertFrom-Json
$ver = $pkg.version
}
echo "VERSION=$ver" >> $env:GITHUB_OUTPUT
echo "Resolved version: $ver"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Sync package.json version
shell: pwsh
run: |
$pkg = Get-Content package.json | ConvertFrom-Json
$pkg.version = "${{ steps.version.outputs.VERSION }}"
$pkg | ConvertTo-Json -Depth 10 | Set-Content package.json -Encoding UTF8
- name: Build & Package
run: npm run dist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: List release artifacts
shell: pwsh
run: Get-ChildItem -Path release -Recurse -File | Select-Object FullName, Length
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.VERSION }}
name: AutoWSGR-GUI v${{ steps.version.outputs.VERSION }}
prerelease: ${{ github.event.inputs.prerelease == 'true' }}
generate_release_notes: true
files: |
release/*-Setup-*.exe
release/*.exe.blockmap
release/latest.yml
body: |
## AutoWSGR-GUI v${{ steps.version.outputs.VERSION }}
### 使用方法
1. 下载 `AutoWSGR-GUI-Setup-*.exe`(安装版)
2. 软件已内置 Python 3.12,无需单独安装
3. 首次运行时程序会自动安装 Python 依赖(需联网)
4. 已安装用户将自动收到增量更新提示
### 系统要求
- Windows 10/11 x64
- 网络连接(首次运行需安装 pip 依赖)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}