diff --git a/.gitignore b/.gitignore index 879b4c1d..2c55eb6c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ build/Release # Dependency directories node_modules/ +node_modules.bak*/ jspm_packages/ # TypeScript v1 declaration files diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..3d49021e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,43 @@ +matrix: + include: + - os: osx + osx_image: xcode10.2 + language: node_js + node_js: "12" + env: + - ELECTRON_CACHE=$HOME/.cache/electron + - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder + + - os: linux + language: node_js + node_js: "12" + dist: trusty + services: docker + language: generic + +cache: + directories: + - node_modules + - $HOME/.cache/electron + - $HOME/.cache/electron-builder + - $HOME/.npm/_prebuilds + +notifications: + email: false + +script: + - | + if [ "$TRAVIS_OS_NAME" == "linux" ]; then + npm install && npm run publish:gh:linux + else + npm run publish:gh:mac + fi + +before_cache: + - rm -rf $HOME/.cache/electron-builder/wine + +# only run this script on pull requests and merges into +# the 'master' and 'prod' branches +branches: + only: + - master diff --git a/README.md b/README.md index 595157ab..0ea82fff 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@

Release version Build status + Build status Downloads Dev branch version diff --git a/license.rtf b/licenses/license.rtf similarity index 100% rename from license.rtf rename to licenses/license.rtf diff --git a/licenses/license_en.txt b/licenses/license_en.txt new file mode 100644 index 00000000..7d99e6f9 --- /dev/null +++ b/licenses/license_en.txt @@ -0,0 +1,5 @@ +This program is only for learning to communicate! +Do not use for commercial purposes! ! +All consequences of using this software are borne by the user! + +By: lyswhut diff --git a/licenses/license_zh.txt b/licenses/license_zh.txt new file mode 100644 index 00000000..3244a95a --- /dev/null +++ b/licenses/license_zh.txt @@ -0,0 +1,5 @@ +本程序仅用于学习交流使用! +请勿用于商业用途!! +使用本软件造成的一切后果由使用者承担! + +By: 落雪无痕 diff --git a/package-lock.json b/package-lock.json index ab92ffe5..9ec31398 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "lx-music-desktop", - "version": "0.2.3", + "version": "0.2.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c1b098ef..eded902b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lx-music-desktop", - "version": "0.2.3", + "version": "0.2.4", "description": "一个免费的音乐下载助手", "main": "./dist/electron/main.js", "productName": "lx-music-desktop", @@ -26,6 +26,15 @@ "publish:win:7z": "npm run publish:win:7z:x64 && npm run publish:win:7z:x86", "publish:win:7z:x64": "cross-env TARGET=green ARCH=x64 electron-builder -w=7z --x64 -p onTagOrDraft", "publish:win:7z:x86": "cross-env TARGET=green ARCH=x86 electron-builder -w=7z --ia32 -p onTagOrDraft", + "publish:gh:mac": "node build-config/pack.js && npm run publish:mac", + "publish:mac": "npm run publish:mac:dmg", + "publish:mac:dmg": "electron-builder -m=dmg -p onTagOrDraft", + "publish:gh:linux": "node build-config/pack.js && npm run publish:linux", + "publish:linux": "npm run publish:linux:appImage && npm run publish:linux:deb", + "publish:linux:appImage": "cross-env ARCH=x64 electron-builder -l=AppImage -p onTagOrDraft", + "publish:linux:deb": "npm run publish:linux:deb:x64 && npm run publish:linux:deb:x86", + "publish:linux:deb:x64": "cross-env ARCH=x64 electron-builder -l=deb --x64 -p onTagOrDraft", + "publish:linux:deb:x86": "cross-env ARCH=x86 electron-builder -l=deb --ia32 -p onTagOrDraft", "pack:linux": "node build-config/pack.js && electron-builder -l", "pack:dir": "node build-config/pack.js && electron-builder --dir", "dev": "node build-config/runner-dev.js", @@ -53,43 +62,51 @@ "files": [ "dist/electron/**/*" ], + "extraResources": [ + "./licenses" + ], "win": { - "icon": "src/static/icons/lunch.ico", + "icon": "./resources/icons/256x256.ico", "legalTrademarks": "lyswhut", "artifactName": "${productName} v${version} ${env.ARCH} ${env.TARGET}.${ext}" }, + "mac": { + "icon": "./resources/icons/512x512.png", + "category": "public.app-category.music" + }, "linux": { - "target": [ - { - "target": "AppImage", - "arch": [ - "x64" - ] - }, - { - "arch": [ - "ia32", - "x64" - ], - "target": "deb" - }, - { - "arch": [ - "x64" - ], - "target": "snap" - } - ], - "maintainer": "lyswhut " + "maintainer": "lyswhut ", + "artifactName": "${productName} v${version} ${env.ARCH}.${ext}" }, "nsis": { "oneClick": false, "language": "2052", "allowToChangeInstallationDirectory": true, "differentialPackage": true, - "license": "./license.rtf", + "license": "./licenses/license.rtf", "shortcutName": "lx-music" }, + "dmg": { + "contents": [ + { + "x": 110, + "y": 150, + "name": "lx-music" + }, + { + "x": 240, + "y": 150, + "type": "link", + "path": "/Applications", + "name": "lx-music" + } + ], + "title": "洛雪音乐助手 v${version}" + }, + "appImage": { + "license": "./licenses/license_zh.txt", + "category": "Audio" + }, "publish": [ { "provider": "github", diff --git a/publish/changeLog.md b/publish/changeLog.md index e69de29b..b75c3a75 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -0,0 +1,8 @@ +### 新增 + +- 新增**MAC**及**Linux**版本(需要的可自行下载) +- 新增任务栏播放进度条控制选项(现在可在设置界面关闭在任务栏显示的播放进度) + +### 修复 + +- 强制把临时接口设置回 `messoer` 接口 diff --git a/src/static/icons/lunch.ico b/resources/icons/256x256.ico similarity index 100% rename from src/static/icons/lunch.ico rename to resources/icons/256x256.ico diff --git a/resources/icons/512x512.icns b/resources/icons/512x512.icns new file mode 100644 index 00000000..8bb1977e Binary files /dev/null and b/resources/icons/512x512.icns differ diff --git a/resources/icons/512x512.png b/resources/icons/512x512.png new file mode 100644 index 00000000..6f6e3c39 Binary files /dev/null and b/resources/icons/512x512.png differ diff --git a/src/common/utils.js b/src/common/utils.js new file mode 100644 index 00000000..831925c7 --- /dev/null +++ b/src/common/utils.js @@ -0,0 +1,4 @@ +export const isLinux = process.platform == 'linux' +export const isWin = process.platform == 'win32' +export const isMac = process.platform == 'darwin' + diff --git a/src/main/index.js b/src/main/index.js index 52f05f20..f223b5bb 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -1,10 +1,11 @@ -const { app, BrowserWindow } = require('electron') +const { app, BrowserWindow, Menu } = require('electron') const path = require('path') require('./events') const progressBar = require('./events/progressBar') const trafficLight = require('./events/trafficLight') const autoUpdate = require('./utils/autoUpdate') +const { isLinux, isMac } = require('../common/utils') const isDev = process.env.NODE_ENV !== 'production' @@ -33,8 +34,8 @@ function createWindow() { useContentSize: true, width: 920, frame: false, - transparent: true, - icon: path.join(global.__static, 'icons/lunch.ico'), + transparent: !isLinux, + // icon: path.join(global.__static, isWin ? 'icons/256x256.ico' : 'icons/512x512.png'), resizable: false, maximizable: false, fullscreenable: false, @@ -58,6 +59,24 @@ function createWindow() { if (!isDev) autoUpdate(mainWindow) } +if (isMac) { + const template = [ + { + label: app.getName(), + submenu: [{ label: '关于洛雪音乐', role: 'about' }, { type: 'separator' }, { label: '隐藏', role: 'hide' }, { label: '显示其他', role: 'hideothers' }, { label: '显示全部', role: 'unhide' }, { type: 'separator' }, { label: '退出', click: () => app.quit() }], + }, + { + label: '窗口', + role: 'window', + submenu: [{ label: '最小化', role: 'minimize' }, { label: '关闭', role: 'close' }], + }, + ] + + Menu.setApplicationMenu(Menu.buildFromTemplate(template)) +} else { + Menu.setApplicationMenu(null) +} + app.once('ready', createWindow) app.on('window-all-closed', () => { diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 31b1f5b6..f649c91c 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -1,5 +1,5 @@