Added automatic app versioning system
This commit is contained in:
parent
74fcaa625c
commit
4604f2176e
24
package.json
24
package.json
@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "deemix-gui",
|
"name": "deemix-gui",
|
||||||
"version": "1.0.0",
|
"version": "0.0.0",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "https://gitlab.com/RemixDev/deemix-gui.git",
|
"repository": "https://gitlab.com/RemixDev/deemix-gui.git",
|
||||||
"author": "RemixDev <RemixDev64@gmail.com>",
|
"author": "RemixDev <RemixDev64@gmail.com>",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"install-all": "yarn install && yarn --cwd server install && yarn --cwd webui install",
|
||||||
"dev": "yarn --cwd webui dev",
|
"dev": "yarn --cwd webui dev",
|
||||||
"start": "electron . --dev",
|
"start": "electron . --dev",
|
||||||
"prebuild": "yarn server-build && yarn --cwd ./webui build",
|
"predist": "yarn build-server && yarn build-webui",
|
||||||
"predist": "yarn prebuild",
|
"dist": "yarn set-version && electron-builder && yarn reset-version",
|
||||||
"dist": "electron-builder",
|
"dist:dir": "yarn set-version && yarn predist && electron-builder --dir && yarn reset-version",
|
||||||
"dist:dir": "electron-builder --dir",
|
"dist-server": "yarn set-version && yarn predist && ./node_modules/.bin/pkg --out-dir dist ./server/package.json && yarn reset-version",
|
||||||
"server-start": "yarn --cwd server start",
|
"start-server": "yarn --cwd server start",
|
||||||
"server-start-build": "yarn --cwd server start-build",
|
"start-server-build": "yarn --cwd server start-build",
|
||||||
"server-lint": "yarn --cwd server lint",
|
"build-server": "yarn --cwd server build",
|
||||||
"server-build": "yarn --cwd server build",
|
"build-webui": "yarn --cwd webui build",
|
||||||
"server-test": "yarn --cwd server test",
|
"set-version": "NEW_VERSION=$(printf \"%s-r%s.%s\" \"$(date +'%Y.%m.%d')\" \"$(git rev-list --count HEAD)\" \"$(git rev-parse --short=10 HEAD)\") && sed -i 's/\"version\": \".*\",/\"version\": \"'\"$NEW_VERSION\"'\",/g' package.json",
|
||||||
"server-test-watch": "yarn --cwd server test-watch",
|
"reset-version": "sed -i 's/\"version\": \".*\",/\"version\": \"0.0.0\",/g' package.json"
|
||||||
"server-dist": "./node_modules/.bin/pkg --out-dir server-dist ./server/package.json"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^12.0.9",
|
"electron": "^12.0.9",
|
||||||
|
2
server/dist/app.js
vendored
2
server/dist/app.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@deemix-gui/deemix-server",
|
"name": "@deemix-gui/deemix-server",
|
||||||
"version": "0.1.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack --watch",
|
"start": "webpack --watch",
|
||||||
|
@ -2,3 +2,4 @@ import path from 'path'
|
|||||||
|
|
||||||
export const ROOT_DIR = path.resolve(path.join(__dirname, '..', '..'))
|
export const ROOT_DIR = path.resolve(path.join(__dirname, '..', '..'))
|
||||||
export const WEBUI_DIR = path.join(ROOT_DIR, 'webui', 'public')
|
export const WEBUI_DIR = path.join(ROOT_DIR, 'webui', 'public')
|
||||||
|
export const GUI_PACKAGE = path.join(ROOT_DIR, 'package.json')
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
import fs from 'fs'
|
||||||
import express from 'express'
|
import express from 'express'
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
import { Deezer } from 'deezer-js'
|
import { Deezer } from 'deezer-js'
|
||||||
|
import { GUI_PACKAGE } from '../helpers/paths'
|
||||||
import { sessionDZ, getQueue, deemixVersion, isDeezerAvailable } from '../main'
|
import { sessionDZ, getQueue, deemixVersion, isDeezerAvailable } from '../main'
|
||||||
|
|
||||||
const router = express.Router()
|
const router = express.Router()
|
||||||
@ -11,9 +13,11 @@ router.get('/connect', async (req, res) => {
|
|||||||
const dz = sessionDZ[req.session.id]
|
const dz = sessionDZ[req.session.id]
|
||||||
|
|
||||||
if (!update) {
|
if (!update) {
|
||||||
|
const currentVersion = JSON.parse(String(fs.readFileSync(GUI_PACKAGE))).version
|
||||||
|
console.log(currentVersion)
|
||||||
update = {
|
update = {
|
||||||
currentCommit: 'testing',
|
currentCommit: currentVersion === '0.0.0' ? 'continuous' : currentVersion,
|
||||||
latestCommit: 'testing',
|
latestCommit: null,
|
||||||
updateAvailable: false,
|
updateAvailable: false,
|
||||||
deemixVersion
|
deemixVersion
|
||||||
}
|
}
|
||||||
|
2
webui
2
webui
@ -1 +1 @@
|
|||||||
Subproject commit 8f7256882a5b3c5b5c4c92545182dac111cc061a
|
Subproject commit a27b6ced123df185d566569941b33aa953e172ef
|
Loading…
Reference in New Issue
Block a user