Skip to content

Commit

Permalink
fix: 修复工作流 & builder 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Nov 29, 2023
1 parent e82ffe8 commit dc11965
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 85 deletions.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ body:
attributes:
label: "当前系统环境"
placeholder: "win11"
- type: input
validations:
required: true
attributes:
label: "当前 Node.js 及 npm 版本"
placeholder: "v18.16.0 / v9.6.7"
- type: input
validations:
required: true
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Dev 分支推送部署预览
## 仅部署 Win 端
name: Build Dev

on:
Expand All @@ -11,35 +13,29 @@ jobs:
runs-on: windows-latest

steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v3.0.0

uses: actions/checkout@v4.1.1
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4.0.0
with:
node-version: "16.x"

node-version: "18.x"
# 安装项目依赖
- name: Install Dependencies
run: npm install

# 构建 Electron App
- name: Build Electron App
run: npm run build:win
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

# 清理不必要的构建产物
- name: Cleanup Artifacts
run: |
npx rimraf "dist/!(*.exe)"
# 上传构建产物
- name: Upload artifacts
uses: actions/upload-artifact@v3.0.0
uses: actions/upload-artifact@v3.1.3
with:
name: SPlayer-dev
path: dist

- name: Create a release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
files: "dist/**"
135 changes: 88 additions & 47 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Release 发行版本部署
## 多端部署
name: Build Release

on:
Expand All @@ -6,95 +8,134 @@ on:
- v*

jobs:
# Windows
build-windows:
name: Build for Windows
runs-on: windows-latest
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v3.0.0

uses: actions/checkout@v4.1.1
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4.0.0
with:
node-version: "16.x"

node-version: "18.x"
# 安装项目依赖
- name: Install Dependencies
run: npm install

# 构建 Electron App
- name: Build Electron App for Windows
run: npm run build:win
run: npm run build:win || true
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

# 上传构建产物
- name: Upload Windows artifact
uses: actions/upload-artifact@v3.0.0
uses: actions/upload-artifact@v3.1.3
with:
name: SPlayer-Windows
path: dist/*.exe

name: SPlarer-Win
if-no-files-found: ignore
path: |
dist/*.exe
dist/*.msi
# 创建 GitHub Release
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
files: |
dist/*.exe
dist/*.msi
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# Mac
build-macos:
name: Build for macOS
runs-on: macos-latest
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v3.0.0

uses: actions/checkout@v4.1.1
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4.0.0
with:
node-version: "16.x"

node-version: "18.x"
# 安装项目依赖
- name: Install Dependencies
run: npm install

# 构建 Electron App
- name: Build Electron App for macOS
run: npm run build:mac
run: npm run build:mac || true
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

# 上传构建产物
- name: Upload macOS artifact
uses: actions/upload-artifact@v3.0.0
uses: actions/upload-artifact@v3.1.3
with:
name: SPlayer-macOS
path: dist/*.dmg

name: SPlarer-Macos
if-no-files-found: ignore
path: |
dist/*.dmg
dist/*.zip
# 创建 GitHub Release
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
files: |
dist/*.dmg
dist/*.zip
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# Linux
build-linux:
name: Build for Linux
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# 检出 Git 仓库
- name: Check out git repository
uses: actions/checkout@v3.0.0

uses: actions/checkout@v4.1.1
# 安装 Node.js
- name: Install Node.js
uses: actions/setup-node@v3.0.0
uses: actions/setup-node@v4.0.0
with:
node-version: "16.x"

node-version: "18.x"
# 更新 Ubuntu 软件源
- name: Ubuntu Update with sudo
run: sudo apt-get update
# 安装项目依赖
- name: Install Dependencies
run: npm install

# 构建 Electron App
- name: Build Electron App for Linux
run: npm run build:linux
run: npm run build:linux || true
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

# 上传构建产物
- name: Upload Linux artifact
uses: actions/upload-artifact@v3.0.0
uses: actions/upload-artifact@v3.1.3
with:
name: SPlayer-Linux
path: dist/*.AppImage

create-release:
needs: [build-windows, build-macos, build-linux]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/[email protected]

- name: Create a release
uses: softprops/action-gh-release@v1
name: SPlarer-Linux
if-no-files-found: ignore
path: |
dist/*.AppImage
dist/*.deb
dist/*.rpm
# 创建 GitHub Release
- name: Release
uses: softprops/[email protected]
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
files: "dist/**"
files: |
dist/*.AppImage
dist/*.deb
dist/*.rpm
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
> [!IMPORTANT]
> ## 🎉 当前项目正在重构中 🎉
>
> - 目前版本进入维护模式,仅在遇到重大问题时会进行修复
> - 支持客户端与网页端
> - 支持现有版本所有功能
> - 新增支持播放与管理本地歌曲
<div align="center">
<img alt="logo" height="80" src="./public/images/logo/favicon.png" />
<h2>SPlayer</h2>
Expand All @@ -8,11 +16,6 @@

## 说明

> **当前项目正在重构中,目前版本进入维护模式,仅在遇到重大问题时会进行修复**
> - 支持客户端与网页端
> - 支持现有版本所有功能
> - 新增支持播放与管理本地歌曲
>
- 本项目采用 [Vue 3](https://cn.vuejs.org/) 全家桶和 [Naïve UI](https://www.naiveui.com/) 组件库及 [Electron](https://www.electronjs.org/zh/docs/latest/) 开发
- 支持网页端与客户端,由于设备有限,目前仅适配 `Win`,其他平台可自行构建
- ~~仅对移动端做了基础适配,**不保证功能全部可用**~~
Expand Down Expand Up @@ -57,7 +60,7 @@
- [ ] 多种布局方式
- [ ] 发表评论

## 😍 Screenshots
## 🖼️ Screenshots

> 开发中,仅供参考
Expand Down Expand Up @@ -103,6 +106,18 @@

</details>

## 📦️ 获取

### 稳定版

通常情况下,可以在 [Releases](https://github.com/imsyy/SPlayer/releases) 中获取稳定版

### 开发版

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

[Dev Workflow](https://github.com/imsyy/SPlayer/actions/workflows/build.yml)

## ⚙️ 部署

> Vercel 等托管平台可在 Fork 后一键导入并自动部署
Expand Down Expand Up @@ -179,12 +194,21 @@ pnpm build:mac
## 📜 开源许可

- **本项目仅供个人学习研究使用,禁止用于商业及非法用途**
- 本项目基于 [MIT license](https://opensource.org/license/mit/) 许可进行开源
- 本项目基于 [GNU General Public License version 3](https://opensource.org/license/gpl-3-0/) 许可进行开源
1. **修改和分发:** 任何对本项目的修改和分发都必须基于 GPL Version 3 进行,源代码必须一并提供
2. **派生作品:** 任何派生作品必须同样采用 GPL Version 3,并在适当的地方注明原始项目的许可证
3. **免责声明:** 根据 GPL Version 3,本项目不提供任何明示或暗示的担保。请详细阅读 GPL Version 3以了解完整的免责声明内容
4. **社区参与:** 欢迎社区的参与和贡献,我们鼓励开发者一同改进和维护本项目
5. **许可证链接:** 请阅读 [GNU General Public License version 3](https://opensource.org/license/gpl-3-0/) 了解更多详情

## 📢 免责声明

本项目使用了网易云音乐的第三方 API 服务,**仅供个人学习研究使用,禁止用于商业及非法用途** 本项目旨在提供一个前端练手的实战项目,用于帮助开发者提升技能水平和对前端技术的理解
本项目部分功能使用了网易云音乐的第三方 API 服务,**仅供个人学习研究使用,禁止用于商业及非法用途**

同时,本项目开发者承诺 **严格遵守相关法律法规和网易云音乐 API 使用协议,不会利用本项目进行任何违法活动。** 如因使用本项目而引起的任何纠纷或责任,均由使用者自行承担。**本项目开发者不承担任何因使用本项目而导致的任何直接或间接责任,并保留追究使用者违法行为的权利**

请使用者在使用本项目时遵守相关法律法规,**不要将本项目用于任何商业及非法用途。如有违反,一切后果由使用者自负。** 同时,使用者应该自行承担因使用本项目而带来的风险和责任。本项目开发者不对本项目所提供的服务和内容做出任何保证

**任何未经授权的商业用途,以及对网易云音乐 API 使用协议的违反,将导致对用户采取法律行动的可能性**

感谢您的理解与合作
26 changes: 19 additions & 7 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# 应用程序的唯一标识符
appId: com.imsyy.splayer
# 应用程序的产品名称
productName: SPlayer-desktop
copyright: 'Copyright © imsyy 2023'
productName: SPlayer
copyright: Copyright © imsyy 2023
# 构建资源所在的目录
directories:
buildResources: public
buildResources: build
# 包含在最终应用程序构建中的文件列表,这里使用通配符 ! 表示排除不需要的文件
files:
- "!**/.vscode/*"
Expand All @@ -22,8 +22,11 @@ win:
executableName: splayer-desktop
# 应用程序的图标文件路径
icon: public/images/logo/favicon_256.png
# 构建的目标类型
# target: "portable"
# 构建类型
target:
- nsis
- portable
# 管理员权限
requestedExecutionLevel: highestAvailable
# NSIS 安装器配置
nsis:
Expand All @@ -43,6 +46,10 @@ nsis:
allowToChangeInstallationDirectory: true
# macOS 平台配置
mac:
# 可执行文件名
executableName: splayer-desktop
# 应用程序的图标文件路径
icon: public/images/logo/favicon_256.png
# 权限继承的文件路径
entitlementsInherit: build/entitlements.mac.plist
# 扩展信息,如权限描述
Expand All @@ -61,9 +68,14 @@ dmg:
artifactName: ${productName}-${version}.${ext}
# Linux 平台配置
linux:
# 目标平台,例如 AppImage、snap、deb 等
# 可执行文件名
executableName: splayer-desktop
# 应用程序的图标文件路径
icon: public/images/logo/favicon_256.png
# 构建类型
target:
- AppImage
- portable
- snap
- deb
- rpm
Expand All @@ -85,4 +97,4 @@ publish:
# 自动更新检查的 URL
# url: https://example.com/auto-updates
owner: "imsyy"
repo: "splayer"
repo: "SPlayer"
Loading

0 comments on commit dc11965

Please sign in to comment.