Skip to content

Commit 56668de

Browse files
committed
🐳 chore: 优化工作流
1 parent 7952bca commit 56668de

10 files changed

Lines changed: 176 additions & 82 deletions

File tree

.github/workflows/dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Dev 分支推送部署预览
2-
## 部署 Windows x64 和 ARM64 版本
2+
## 部署 Windows
33
name: Build Dev
44

55
on:
@@ -52,7 +52,7 @@ jobs:
5252
# 构建 Electron App (x64)
5353
- name: Build Electron App for Windows x64
5454
# 仅 x64
55-
run: pnpm run build:win -- --arch=x64
55+
run: pnpm run build:win -- --x64
5656
env:
5757
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5858
# 清理不必要的构建产物(保留 .exe 和 .blockmap 文件)

.github/workflows/issue-helper.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Issue Helper
2+
3+
on:
4+
issues:
5+
types: [opened, labeled]
6+
7+
# 权限配置
8+
permissions:
9+
issues: write
10+
11+
jobs:
12+
issue-handler:
13+
runs-on: ubuntu-latest
14+
steps:
15+
# 自动欢迎
16+
- name: Welcome Comment
17+
if: github.event_name == 'issues' && github.event.action == 'opened'
18+
uses: actions-cool/issues-helper@v3
19+
with:
20+
actions: "create-comment"
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
body: |
23+
👋 您好 @${{ github.actor }},感谢提交 Issue!
24+
🚀 我们已经收到您的反馈,会尽快确认你的问题
25+
26+
在等待回复期间,您可以:
27+
- 📖 查看 [项目文档](https://github.com/imsyy/SPlayer/blob/dev/README.md)
28+
- 💬 加入 [交流群](https://qm.qq.com/cgi-bin/qm/qr?k=2-cVSf1bE0AvAehCib00qFEFdUvPaJ_k&jump_from=webapi&authKey=1NEhib9+GsmsXVo2rCc0IbRaVHeeRXJJ0gbsyKDcIwDdAzYySOubkFCvkV32+7Cw) 进行实时讨论
29+
- 🔍 搜索 [现有 Issues](https://github.com/imsyy/SPlayer/issues) 查看是否有类似问题
30+
# 自动关闭
31+
- name: Auto Close
32+
if: github.event.action == 'labeled' && contains(fromJSON('["不会修复", "无效", "重复"]'), github.event.label.name)
33+
uses: actions-cool/issues-helper@v3
34+
with:
35+
actions: "create-comment, close-issue"
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
body: |
38+
抱歉,由于该 Issue 被标记为 **${{ github.event.label.name }}**,系统将自动将其关闭
39+
如果您认为该 Issue 仍然有效,请重新开启或者创建新的 Issue,我们会尽快确认并修复
40+
# 有问题回复
41+
- name: Auto Reply
42+
if: github.event.action == 'labeled' && github.event.label.name == '有问题'
43+
uses: actions-cool/issues-helper@v3
44+
with:
45+
actions: "create-comment"
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
body: |
48+
🤝 您好 @${{ github.actor }},感谢您的反馈!我们注意到该问题被添加了 **${{ github.event.label.name }}**
49+
由于缺少复现步骤,我们无法重现问题,因此无法修复
50+
请确保您已经详细描述了问题的复现步骤,维护团队会尽快查看
51+
# 已确认 BUG
52+
- name: Auto Confirm BUG
53+
if: github.event.action == 'labeled' && github.event.label.name == 'BUG'
54+
uses: actions-cool/issues-helper@v3
55+
with:
56+
actions: "remove-labels, create-comment"
57+
token: ${{ secrets.GITHUB_TOKEN }}
58+
labels: "有问题"
59+
body: |
60+
🤝 您好 @${{ github.actor }},感谢您的反馈!我们已经确认该问题,并将在下一个版本中修复
61+
# 已修复
62+
- name: Auto Fixed
63+
if: github.event.action == 'labeled' && github.event.label.name == '已修复'
64+
uses: actions-cool/issues-helper@v3
65+
with:
66+
actions: "create-comment, remove-labels, close-issue"
67+
token: ${{ secrets.GITHUB_TOKEN }}
68+
labels: "BUG"
69+
close-reason: "completed"
70+
body: |
71+
🎉 您好 @${{ github.actor }},该问题已修复,感谢您的反馈!
72+
73+
若您觉得仍存在问题,请重新开启或者创建新的 Issue,我们会尽快确认并修复

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
NODE_VERSION: 22.x
11-
PNPM_VERSION: 8
11+
PNPM_VERSION: 10
1212
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
1313

1414
jobs:
@@ -98,18 +98,18 @@ jobs:
9898
# 构建 Electron App
9999
- name: Build Windows x64 & ARM64 App
100100
if: runner.os == 'Windows'
101-
run: pnpm build:win || true
101+
run: pnpm build:win -- --x64 --arm64 || true
102102
env:
103103
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104104
- name: Build macOS Universal App
105105
if: runner.os == 'macOS'
106-
run: pnpm build:mac || true
106+
run: pnpm build:mac -- --x64 --arm64 || true
107107
shell: bash
108108
env:
109109
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110110
- name: Build Linux x64 & ARM64 App
111111
if: runner.os == 'Linux'
112-
run: pnpm build:linux || true
112+
run: pnpm build:linux -- --x64 --arm64 || true
113113
shell: bash
114114
env:
115115
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Stale Issue & PR Management
2+
3+
permissions:
4+
issues: write
5+
pull-requests: write
6+
7+
on:
8+
schedule:
9+
- cron: "0 0 * * *" # 每天零点运行
10+
workflow_dispatch: # 可手动运行
11+
12+
jobs:
13+
stale:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Mark and close stale issues & PRs
17+
uses: actions/stale@v8
18+
with:
19+
repo-token: ${{ secrets.GITHUB_TOKEN }}
20+
# 过期规则
21+
# 30 天后标记为 stale
22+
days-before-stale: 30
23+
# 7 天后关闭
24+
days-before-close: 7
25+
# 自动评论内容
26+
stale-issue-message: |
27+
👀 该 Issue 已经 30 天没有任何更新啦
28+
如果问题仍然存在,请回复此评论,否则将在 7 天后自动关闭
29+
stale-pr-message: |
30+
👀 该 Pull Request 已经 30 天没有活动啦
31+
如仍需继续处理,请回复此评论,否则将在 7 天后自动关闭
32+
# 给过期项添加的标签
33+
stale-issue-label: "过期"
34+
stale-pr-label: "过期"
35+
# 不会被标记为 stale 的 PR 和 Issue
36+
exempt-draft-pr: true
37+
exempt-issue-labels: "重要,高优先级 P0,中优先级 P1,需要帮助"
38+
exempt-pr-labels: "重要,高优先级 P0,中优先级 P1,需要帮助"

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@
129129

130130
可以通过 `GitHub Actions` 工作流获取最新的开发版,目前开发版仅提供 `Win` 版本
131131

132-
[Dev Workflow](https://github.com/imsyy/SPlayer/actions/workflows/build.yml)
132+
> 如需其他平台的开发版构建,请自行 Fork 本项目并参考 `.github/workflows/release.yml` 创建相应的工作流
133+
134+
[Dev Workflow](https://github.com/imsyy/SPlayer/actions/workflows/dev.yml)
133135

134136
## Snap Store
135137

@@ -231,6 +233,8 @@ docker run -d --name SPlayer -p 25884:25884 imsyy/splayer:latest
231233
5. 复制 `/.env.example` 文件并重命名为 `/.env` 并修改配置
232234
6. 打包客户端,请依据你的系统类型来选择,打包成功后,会输出安装包或可执行文件在 `/dist` 目录中,可自行安装
233235

236+
> 默认情况下,构建命令仅会构建当前系统架构的版本。如需构建特定架构(如 x64 + arm64),请在命令后追加参数,例如:`pnpm build:win -- --x64 --arm64`
237+
234238
| 命令 | 系统类型 |
235239
| ------------------ | -------- |
236240
| `pnpm build:win` | Windows |

electron-builder.config.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ const config: Configuration = {
3737
// 安装版
3838
{
3939
target: "nsis",
40-
arch: ["x64", "arm64"],
4140
},
4241
// 打包版
4342
{
4443
target: "portable",
45-
arch: ["x64", "arm64"],
4644
},
4745
],
4846
},
@@ -99,12 +97,10 @@ const config: Configuration = {
9997
// DMG 安装版
10098
{
10199
target: "dmg",
102-
arch: ["x64", "arm64"],
103100
},
104101
// 压缩包安装版
105102
{
106103
target: "zip",
107-
arch: ["x64", "arm64"],
108104
},
109105
],
110106
},
@@ -121,22 +117,18 @@ const config: Configuration = {
121117
// Pacman 包管理器
122118
{
123119
target: "pacman",
124-
arch: ["x64", "arm64"],
125120
},
126121
// AppImage 格式
127122
{
128123
target: "AppImage",
129-
arch: ["x64", "arm64"],
130124
},
131125
// Debian 包管理器
132126
{
133127
target: "deb",
134-
arch: ["x64", "arm64"],
135128
},
136129
// RPM 包管理器
137130
{
138131
target: "rpm",
139-
arch: ["x64", "arm64"],
140132
},
141133
// Snap 包管理器(仅支持 x64 架构)
142134
{
@@ -146,7 +138,6 @@ const config: Configuration = {
146138
// 压缩包格式
147139
{
148140
target: "tar.gz",
149-
arch: ["x64", "arm64"],
150141
},
151142
],
152143
// 维护者信息

src/components/Player/PlayerSpectrum.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ const isKeepDrawing = ref<boolean>(true);
2424
* 绘制音乐频谱图
2525
*/
2626
const drawSpectrum = () => {
27-
// 直接从 Player 获取数据
2827
const spectrumData = player.getSpectrumData();
2928
if (!spectrumData) return;
30-
31-
const data = Array.from(spectrumData).slice(10); // 转换为普通数组并处理
29+
// 转换为普通数组并处理
30+
const data = Array.from(spectrumData).slice(10);
3231
if (!isKeepDrawing.value || !canvasRef.value) return;
3332
// 设置画布宽度,最大为 1600
3433
canvasRef.value.width = document.body.clientWidth >= 1600 ? 1600 : document.body.clientWidth;

src/components/Setting/PlaySetting.vue

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -248,18 +248,6 @@
248248
</div>
249249
<n-switch v-model:value="settingStore.smtcOpen" class="set" :round="false" />
250250
</n-card>
251-
<n-card class="set-item">
252-
<div class="label">
253-
<n-text class="name">输出高清封面</n-text>
254-
<n-text class="tip" :depth="3">开启 SMTC 时是否输出高清封面</n-text>
255-
</div>
256-
<n-switch
257-
v-model:value="settingStore.smtcOutputHighQualityCover"
258-
class="set"
259-
:round="false"
260-
:disabled="!settingStore.smtcOpen || true"
261-
/>
262-
</n-card>
263251
</div>
264252
</div>
265253
</template>

src/stores/setting.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ export interface SettingState {
122122
showSpectrums: boolean;
123123
/** 是否开启 SMTC */
124124
smtcOpen: boolean;
125-
/** 是否输出高清封面 */
126-
smtcOutputHighQualityCover: boolean;
127125
/** 歌词模糊 */
128126
lyricsBlur: boolean;
129127
/** 鼠标悬停暂停 */
@@ -226,7 +224,6 @@ export const useSettingStore = defineStore("setting", {
226224
showPlaylistCount: true,
227225
showSpectrums: false,
228226
smtcOpen: true,
229-
smtcOutputHighQualityCover: false,
230227
playSongDemo: false,
231228
scrobbleSong: false,
232229
dynamicCover: false,

0 commit comments

Comments
 (0)