Added automatic app versioning system

This commit is contained in:
RemixDev 2021-07-18 21:59:41 +02:00
parent 74fcaa625c
commit 4604f2176e
6 changed files with 22 additions and 17 deletions

View File

@ -1,24 +1,24 @@
{
"name": "deemix-gui",
"version": "1.0.0",
"version": "0.0.0",
"main": "index.js",
"repository": "https://gitlab.com/RemixDev/deemix-gui.git",
"author": "RemixDev <RemixDev64@gmail.com>",
"license": "GPL-3.0-only",
"scripts": {
"install-all": "yarn install && yarn --cwd server install && yarn --cwd webui install",
"dev": "yarn --cwd webui dev",
"start": "electron . --dev",
"prebuild": "yarn server-build && yarn --cwd ./webui build",
"predist": "yarn prebuild",
"dist": "electron-builder",
"dist:dir": "electron-builder --dir",
"server-start": "yarn --cwd server start",
"server-start-build": "yarn --cwd server start-build",
"server-lint": "yarn --cwd server lint",
"server-build": "yarn --cwd server build",
"server-test": "yarn --cwd server test",
"server-test-watch": "yarn --cwd server test-watch",
"server-dist": "./node_modules/.bin/pkg --out-dir server-dist ./server/package.json"
"predist": "yarn build-server && yarn build-webui",
"dist": "yarn set-version && electron-builder && yarn reset-version",
"dist:dir": "yarn set-version && yarn predist && electron-builder --dir && yarn reset-version",
"dist-server": "yarn set-version && yarn predist && ./node_modules/.bin/pkg --out-dir dist ./server/package.json && yarn reset-version",
"start-server": "yarn --cwd server start",
"start-server-build": "yarn --cwd server start-build",
"build-server": "yarn --cwd server build",
"build-webui": "yarn --cwd webui build",
"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",
"reset-version": "sed -i 's/\"version\": \".*\",/\"version\": \"0.0.0\",/g' package.json"
},
"devDependencies": {
"electron": "^12.0.9",

2
server/dist/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "@deemix-gui/deemix-server",
"version": "0.1.0",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "webpack --watch",

View File

@ -2,3 +2,4 @@ import path from 'path'
export const ROOT_DIR = path.resolve(path.join(__dirname, '..', '..'))
export const WEBUI_DIR = path.join(ROOT_DIR, 'webui', 'public')
export const GUI_PACKAGE = path.join(ROOT_DIR, 'package.json')

View File

@ -1,6 +1,8 @@
import fs from 'fs'
import express from 'express'
// @ts-expect-error
import { Deezer } from 'deezer-js'
import { GUI_PACKAGE } from '../helpers/paths'
import { sessionDZ, getQueue, deemixVersion, isDeezerAvailable } from '../main'
const router = express.Router()
@ -11,9 +13,11 @@ router.get('/connect', async (req, res) => {
const dz = sessionDZ[req.session.id]
if (!update) {
const currentVersion = JSON.parse(String(fs.readFileSync(GUI_PACKAGE))).version
console.log(currentVersion)
update = {
currentCommit: 'testing',
latestCommit: 'testing',
currentCommit: currentVersion === '0.0.0' ? 'continuous' : currentVersion,
latestCommit: null,
updateAvailable: false,
deemixVersion
}

2
webui

@ -1 +1 @@
Subproject commit 8f7256882a5b3c5b5c4c92545182dac111cc061a
Subproject commit a27b6ced123df185d566569941b33aa953e172ef