Skip to content

Commit

Permalink
Prepare for beta release
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Dec 7, 2021
1 parent cf23072 commit 2d50b33
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 15 deletions.
10 changes: 9 additions & 1 deletion app/application/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,12 +852,20 @@ const provideFeedback = () => {
ipc.send("provideFeedback")
}

// ? build
/**
* Get app information
*/
const res = ipc.sendSync("info")

/**
* Show build number if version is pre release
*/
if (res.build_number.startsWith("alpha")) {
document.querySelector(".build-content").textContent = `You are running an alpha version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
} else if (res.build_number.startsWith("beta")) {
document.querySelector(".build-content").textContent = `You are running a beta version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
}

// ? buttons
Expand Down
10 changes: 9 additions & 1 deletion app/confirm/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,20 @@ const folder_path = dev ? path.join(app.getPath("appData"), "Levminer", "Authme
*/
let settings = JSON.parse(fs.readFileSync(path.join(folder_path, "settings", "settings.json"), "utf-8"))

// ? build
/**
* Get app information
*/
const res = ipc.sendSync("info")

/**
* Show build number if version is pre release
*/
if (res.build_number.startsWith("alpha")) {
document.querySelector(".build-content").textContent = `You are running an alpha version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
} else if (res.build_number.startsWith("beta")) {
document.querySelector(".build-content").textContent = `You are running a beta version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
}

// ? init
Expand Down
10 changes: 9 additions & 1 deletion app/edit/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,20 @@ const settings_refresher = setInterval(() => {
}
}, 100)

// ? build
/**
* Get app information
*/
const res = ipc.sendSync("info")

/**
* Show build number if version is pre release
*/
if (res.build_number.startsWith("alpha")) {
document.querySelector(".build-content").textContent = `You are running an alpha version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
} else if (res.build_number.startsWith("beta")) {
document.querySelector(".build-content").textContent = `You are running a beta version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
}

// ? rollback
Expand Down
10 changes: 9 additions & 1 deletion app/export/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ if (app.isPackaged === false) {
dev = true
}

// ? build
/**
* Get app information
*/
const res = ipc.sendSync("info")

/**
* Show build number if version is pre release
*/
if (res.build_number.startsWith("alpha")) {
document.querySelector(".build-content").textContent = `You are running an alpha version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
} else if (res.build_number.startsWith("beta")) {
document.querySelector(".build-content").textContent = `You are running a beta version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
}

// ? init codes for save to qr codes
Expand Down
10 changes: 9 additions & 1 deletion app/landing/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,20 @@ const folder_path = dev ? path.join(app.getPath("appData"), "Levminer", "Authme
*/
let settings = JSON.parse(fs.readFileSync(path.join(folder_path, "settings", "settings.json"), "utf-8"))

// ? build
/**
* Get app information
*/
const res = ipc.sendSync("info")

/**
* Show build number if version is pre release
*/
if (res.build_number.startsWith("alpha")) {
document.querySelector(".build-content").textContent = `You are running an alpha version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
} else if (res.build_number.startsWith("beta")) {
document.querySelector(".build-content").textContent = `You are running a beta version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
}

// ? create storage
Expand Down
21 changes: 14 additions & 7 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@ window.onerror = (error) => {
// ? choose settings
document.querySelector("#setting").click()

// ? get app infos
/**
* Get app information
*/
const res = ipc.sendSync("info")

/**
* Show build number if version is pre release
*/
if (res.build_number.startsWith("alpha")) {
document.querySelector(".build-content").textContent = `You are running an alpha version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
} else if (res.build_number.startsWith("beta")) {
document.querySelector(".build-content").textContent = `You are running a beta version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
}

// set app version
document.querySelector("#but7").innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
Expand Down Expand Up @@ -800,12 +813,6 @@ const edit = () => {
ipc.send("toggleEdit")
}

// ? build
if (res.build_number.startsWith("alpha")) {
document.querySelector(".build-content").textContent = `You are running an alpha version of Authme - Version ${res.authme_version} - Build ${res.build_number}`
document.querySelector(".build").style.display = "block"
}

// ? offline mode
let offline_mode = false
let offline_closed = false
Expand Down
2 changes: 1 addition & 1 deletion app/splash/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ window.onerror = (error) => {

// ? get version and release date
const res = ipcRenderer.sendSync("info")
if (res.build_number.startsWith("alpha")) {
if (res.build_number.startsWith("alpha") || res.build_number.startsWith("beta")) {
document.querySelector("#ver").textContent = `Authme ${res.authme_version} (${res.build_number})`
} else {
document.querySelector("#ver").textContent = `Authme ${res.authme_version} (${res.release_date})`
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if (app.isPackaged === false) {

// pre release
let pre_release = false
if (number.startsWith("alpha")) {
if (number.startsWith("alpha") || number.startsWith("beta")) {
pre_release = true
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"license": "GPL-3.0",
"scripts": {
"start": "node scripts/alpha-build.js && electron .",
"dev": "node scripts/release-build.js && electron .",
"dev": "node scripts/beta-build.js && electron .",
"build": "npm run build:release",
"build:release": "node scripts/release-build.js && electron-builder --publish=never --x64",
"build:beta": "node scripts/beta-build.js && electron-builder --publish=never --x64",
"build:alpha": "node scripts/alpha-build.js && electron-builder --publish=never --x64",
"build:test": "node scripts/alpha-build.js && electron-builder --publish=never --x64 --dir -c scripts/test-build.json",
"build:styles": "concurrently 'npm:watch:tw' 'npm:watch:gb'",
Expand Down
24 changes: 24 additions & 0 deletions scripts/beta-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const fs = require("fs")

const build = new Date().toISOString().replace("T", "X").replaceAll(":", ".").substring(0, 19).replaceAll("-", ".").slice(2).replaceAll(".", "").replace("X", ".")

const date = new Date()

const year = date.getFullYear()
const month = date.toLocaleString("en-us", { timeZone: "UTC", month: "long" })
const day = date.toISOString().substring(8, 10)

const build_number = `beta.${build}`
const release_date = `${year}. ${month} ${day}.`

const file = {
number: build_number,
date: release_date,
}

if (!fs.existsSync("dist")) {
fs.mkdirSync("dist")
}

fs.writeFileSync("build.json", JSON.stringify(file, null, "\t"))
fs.writeFileSync("dist/build.json", JSON.stringify(file, null, "\t"))

0 comments on commit 2d50b33

Please sign in to comment.