Add release build config

This commit is contained in:
Andrei Andreev 2022-11-30 01:03:24 +01:00
parent 33dfb81e8c
commit 7f72d5a205
7 changed files with 46 additions and 6 deletions

1
.env.master Normal file
View File

@ -0,0 +1 @@
VUE_APP_DEV=true

View File

@ -22,7 +22,7 @@ jobs:
cache: 'npm' cache: 'npm'
- run: npm ci - run: npm ci
- run: npm run build - run: npm run build
- uses: JamesIves/github-pages-deploy-action@4.1.3 - uses: JamesIves/github-pages-deploy-action@4.4.1
with: with:
branch: gh-pages branch: gh-pages
folder: dist folder: dist

31
.github/workflows/deploy-release.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: Deploy 🚀
on:
push:
branches:
- master
workflow_dispatch:
branches:
- master
jobs:
build:
name: Deploy 🚀
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
lfs: true
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
- run: npm ci
- run: npm run build
- uses: JamesIves/github-pages-deploy-action@4.4.1
with:
token: ${{ secrets.GH_PUBLISH_TOKEN }}
repository-name: IvarK/AyyLmao5Hours
branch: master
folder: dist
single-commit: true

View File

@ -3,7 +3,7 @@ import { sha512_256 } from "js-sha512";
import { DC } from "./constants"; import { DC } from "./constants";
import FullScreenAnimationHandler from "./full-screen-animation-handler"; import FullScreenAnimationHandler from "./full-screen-animation-handler";
export const DEV = true; export const DEV = process.env.VUE_APP_DEV === "true";
/* eslint-disable no-console */ /* eslint-disable no-console */
// Disabling no-console here seems // Disabling no-console here seems

View File

@ -6,6 +6,7 @@ import { SpeedrunMilestones } from "./core/speedrun";
import { supportedBrowsers } from "./supported-browsers"; import { supportedBrowsers } from "./supported-browsers";
import Payments from "./core/payments"; import Payments from "./core/payments";
import { DEV } from "./core/devtools";
if (GlobalErrorHandler.handled) { if (GlobalErrorHandler.handled) {
throw new Error("Initialization failed"); throw new Error("Initialization failed");
@ -1048,6 +1049,10 @@ export function browserCheck() {
export function init() { export function init() {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log("🌌 Antimatter Dimensions: Reality Update 🌌"); console.log("🌌 Antimatter Dimensions: Reality Update 🌌");
if (DEV) {
// eslint-disable-next-line no-console
console.log("👨‍💻 Development Mode 👩‍💻");
}
GameStorage.load(); GameStorage.load();
Tabs.all.find(t => t.config.id === player.options.lastOpenTab).show(true); Tabs.all.find(t => t.config.id === player.options.lastOpenTab).show(true);
Payments.init(); Payments.init();

View File

@ -2,7 +2,8 @@
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "node build/check-npm.js && vue-cli-service serve", "serve": "node build/check-npm.js && vue-cli-service serve",
"build": "node build/pre-build.js && vue-cli-service build && node build/post-build.js", "build:master": "node build/pre-build.js && vue-cli-service build --mode master && node build/post-build.js",
"build:release": "node build/pre-build.js && vue-cli-service build && node build/post-build.js",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {

View File

@ -1,11 +1,13 @@
/** /**
* @type {import('@vue/cli-service').ProjectOptions} * @type {import('@vue/cli-service').ProjectOptions}
*/ */
const isDev = process.env.VUE_APP_DEV === "true";
module.exports = { module.exports = {
publicPath: "./", publicPath: "./",
lintOnSave: false, lintOnSave: false,
configureWebpack: { configureWebpack: {
devtool: "eval-source-map", devtool: isDev ? "eval-source-map" : "source-map",
}, }
runtimeCompiler: true
}; };