Skip to content

Commit

Permalink
Merge branch 'qier222-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shi committed Mar 28, 2022
2 parents b31a06d + b7645e2 commit f3faed6
Show file tree
Hide file tree
Showing 378 changed files with 5,394 additions and 17,438 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.github
.gitignore
README.md
LICENSE
.vscode
dist
dist_electron
build
images
script
13 changes: 9 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- master
tags:
- v*
workflow_dispatch:

jobs:
release:
Expand All @@ -18,11 +19,14 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.16.0
node-version: 16
cache: 'yarn'

- name: Install RPM & Pacman (on Ubuntu)
if: runner.os == 'Linux'
Expand All @@ -35,8 +39,9 @@ jobs:
- name: Install Snapcraft (on Ubuntu)
uses: samuelmeuli/action-snapcraft@v1
if: startsWith(matrix.os, 'ubuntu')
with:
snapcraft_token: ${{ secrets.snapcraft_token }}
# with:
# Disable since the Snapcraft token is currently not working
# snapcraft_token: ${{ secrets.snapcraft_token }}

- name: Build/release Electron app
uses: samuelmeuli/[email protected]
Expand Down
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
build
coverage
dist
netease_api

1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"endOfLine": "lf",
"bracketSpacing": true,
Expand Down
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM node:16.13.1-alpine as build
ENV VUE_APP_NETEASE_API_URL=/api
WORKDIR /app
RUN apk add --no-cache python3 make g++ git
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
RUN yarn build

FROM nginx:1.20.2-alpine as app
RUN echo $'server { \n\
gzip on;\n\
listen 80; \n\
listen [::]:80; \n\
server_name localhost; \n\
\n\
location / { \n\
root /usr/share/nginx/html; \n\
index index.html; \n\
try_files $uri $uri/ /index.html; \n\
} \n\
\n\
location @rewrites { \n\
rewrite ^(.*)$ /index.html last; \n\
} \n\
\n\
location /api/ { \n\
proxy_set_header Host $host; \n\
proxy_set_header X-Real-IP $remote_addr; \n\
proxy_set_header X-Forwarded-For $remote_addr; \n\
proxy_set_header X-Forwarded-Host $remote_addr; \n\
proxy_set_header X-NginX-Proxy true; \n\
proxy_pass http://localhost:3000/; \n\
} \n\
}' > /etc/nginx/conf.d/default.conf

RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main libuv \
&& apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main nodejs npm \
&& npm i -g NeteaseCloudMusicApi

COPY --from=build /app/dist /usr/share/nginx/html

CMD nginx ; exec npx NeteaseCloudMusicApi
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2020 qier222
Copyright (c) 2021 shih-liang
Copyright (c) 2020-2022 qier222
Copyright (c) 2021-2022 shih-liang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- 🟥 支持 Last.fm Scrobble
- ☁️ 支持音乐云盘
- ⌨️ 自定义快捷键和全局快捷键
- 🎧 支持Mpris
- 🛠 更多特性开发中

## 📦️ 安装
Expand Down Expand Up @@ -81,7 +82,7 @@
2. 克隆本仓库

```sh
git clone https://github.com/shih-liang/YesPlayMusicOSD.git
git clone --recursive https://github.com/shih-liang/YesPlayMusicOSD.git
```

3. 安装依赖
Expand All @@ -107,14 +108,36 @@ yarn run build

7.`/dist` 目录下的文件上传到你的 Web 服务器

## ⚙️ Docker 部署

1. 构建 Docker Image

```sh
docker build -t yesplaymusic .
```

2. 启动 Docker Container

```sh
docker run -d --name YesPlayMusic -p 80:80 yesplaymusic
```

3. Docker Compose 启动

```sh
docker-compose up -d
```

YesPlayMusic 地址为 `http://localhost`

## 👷‍♂️ 打包客户端

如果在 Release 页面没有找到适合你的设备的安装包的话,你可以根据下面的步骤来打包自己的客户端。

1. 打包 Electron 需要用到 Node.js 和 Yarn。可前往 [Node.js 官网](https://nodejs.org/zh-cn/) 下载安装包。安装 Node.js
后可在终端里执行 `npm install -g yarn` 来安装 Yarn。

2. 使用 `git clone https://github.com/shih-liang/YesPlayMusicOSD.git` 克隆本仓库到本地。
2. 使用 `git clone --recursive https://github.com/shih-liang/YesPlayMusicOSD.git` 克隆本仓库到本地。

3. 使用 `yarn install` 安装项目依赖。

Expand All @@ -131,7 +154,7 @@ yarn run build

## :computer: 配置开发环境

本项目由 [NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) 提供 API,已经包含在本项目的`netease_api`目录
本项目由 [NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) 提供 API。

运行本项目

Expand All @@ -152,9 +175,6 @@ yarn electron:serve
本地运行 NeteaseCloudMusicApi,或者将 API [部署至 Vercel](#%EF%B8%8F-部署至-vercel)

```shell
# 安装依赖
yarn netease_api:install

# 运行 API (默认 3000 端口)
yarn netease_api:run
```
Expand Down
12 changes: 8 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-optional-chaining",
presets: [
[
'@vue/cli-plugin-babel/preset',
{
useBuiltIns: 'usage',
shippedProposals: true,
},
],
],
};
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
YesPlayMusic:
build:
context: .
image: yesplaymusic
container_name: YesPlayMusic
ports:
- 80:80
restart: always
34 changes: 0 additions & 34 deletions netease_api/.editorconfig

This file was deleted.

49 changes: 0 additions & 49 deletions netease_api/.eslintrc.js

This file was deleted.

5 changes: 0 additions & 5 deletions netease_api/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions netease_api/.npmignore

This file was deleted.

5 changes: 0 additions & 5 deletions netease_api/.prettierrc

This file was deleted.

4 changes: 0 additions & 4 deletions netease_api/.travis.yml

This file was deleted.

Loading

0 comments on commit f3faed6

Please sign in to comment.