mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-10 01:14:27 +08:00
ci: fix generate version plugin hiding previous errors (@fehmer) (#7060)
When build fails for some reason the generate version step also failed because the `/dist` directory is missing. This was hiding other problems like an error in the fontawesome step. Also changes the trigger for the frontend build to include `html` files.
This commit is contained in:
parent
78b0eb25ab
commit
b5755faa30
3 changed files with 17 additions and 4 deletions
2
.github/workflows/monkey-ci.yml
vendored
2
.github/workflows/monkey-ci.yml
vendored
|
|
@ -49,7 +49,7 @@ jobs:
|
|||
- 'backend/**/*.{ts,js,json,lua,css,html}'
|
||||
- 'backend/package.json'
|
||||
fe-src:
|
||||
- 'frontend/**/*.{ts,scss}'
|
||||
- 'frontend/**/*.{ts,scss,html}'
|
||||
- 'frontend/package.json'
|
||||
pkg-src:
|
||||
- 'packages/**/*'
|
||||
|
|
|
|||
|
|
@ -99,7 +99,9 @@ export function getFontawesomeConfig(debug = false): FontawesomeConfig {
|
|||
(it) => !(solid.includes(it) || regular.includes(it) || brands.includes(it))
|
||||
);
|
||||
if (leftOvers.length !== 0) {
|
||||
throw new Error("unknown icons: " + leftOvers.toString());
|
||||
throw new Error(
|
||||
"Fontawesome failed with unknown icons: " + leftOvers.toString()
|
||||
);
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,13 @@ import { checker } from "vite-plugin-checker";
|
|||
import { writeFileSync } from "fs";
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import UnpluginInjectPreload from "unplugin-inject-preload/vite";
|
||||
import { readdirSync, readFileSync, statSync } from "node:fs";
|
||||
import {
|
||||
existsSync,
|
||||
mkdirSync,
|
||||
readdirSync,
|
||||
readFileSync,
|
||||
statSync,
|
||||
} from "node:fs";
|
||||
import { ViteMinifyPlugin } from "vite-plugin-minify";
|
||||
import { sentryVitePlugin } from "@sentry/vite-plugin";
|
||||
import { getFontsConig } from "./vite.config";
|
||||
|
|
@ -68,9 +74,14 @@ export default {
|
|||
apply: "build",
|
||||
|
||||
closeBundle() {
|
||||
const distPath = path.resolve(__dirname, "dist");
|
||||
if (!existsSync(distPath)) {
|
||||
mkdirSync(distPath, { recursive: true });
|
||||
}
|
||||
|
||||
const version = CLIENT_VERSION;
|
||||
const versionJson = JSON.stringify({ version });
|
||||
const versionPath = path.resolve(__dirname, "dist/version.json");
|
||||
const versionPath = path.resolve(distPath, "version.json");
|
||||
writeFileSync(versionPath, versionJson);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue