diff --git a/.github/workflows/cd-host.yml b/.github/workflows/cd-host.yml index 9583fce5e..b75d31c4a 100644 --- a/.github/workflows/cd-host.yml +++ b/.github/workflows/cd-host.yml @@ -23,12 +23,6 @@ jobs: with: node-version: 18 - - name: Install Yarn - run: npm install --location=global yarn - - - name: Add fixed sharp - run: yarn add sharp@0.33.1 --ignore-engines - - name: Download release assets run: | DOWNLOAD_URL=$(curl -s https://api.github.com/repos/tresabhi/blitzkrieg/releases/latest \ diff --git a/docs/changelogs/1.18.0.md b/docs/changelogs/1.18.0.md new file mode 100644 index 000000000..a3bcbfe10 --- /dev/null +++ b/docs/changelogs/1.18.0.md @@ -0,0 +1,19 @@ +# Blitzkrieg 1.18.0 + +Introducing the new `/rating` command! + +## Features + +- `/rating` command + - Features statistics on today's performance in ratings + - The included stats are battles, winrate, damage, survival, and kills + - This command also features the score, rank, and league you are at plus the reward you'll get if you are high enough on the leaderboard +- `/ratings`, the old leaderboard command, has been renamed `/rating-leaderboard` + - Reward icons have been removed from the leaderboard + +## Technical Changes + +- Rating leaderboards are now built in a more action-efficient manner. + - This version also introduces the BKRL (Blitzkrieg rating leaderboard) file format which is an efficient way to store entire leaderboards of regions to disk (1 MB per 40,000 users). + - Latest archival actions now build all regions at once in a single action. +- The sharp module is now included in the build. diff --git a/package.json b/package.json index 07bc47704..bd997624d 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,13 @@ "main": "src/server.ts", "type": "module", "scripts": { - "build:bot": "vite-node --script scripts/build", + "build:bot": "vite-node --script scripts/build --production", "build:website": "next build && next-sitemap --config next-sitemap.config.cjs", "build:docs": "vitepress build docs", "build:ratingleaderboard": "vite-node --script scripts/buildRatingLeaderboard", "build:assets": "vite-node --max_old_space_size=16384 --script scripts/buildAssets/index", "build:test": "vite-node --script scripts/buildTest", - "dev:bot": "yarn build:bot --dev && yarn start:bot", + "dev:bot": "vite-node --script scripts/build --production && yarn start:bot", "dev:docs": "vitepress dev docs", "dev:website": "next dev", "start:bot": "node --enable-source-maps dist/bot/index.cjs", diff --git a/scripts/build.ts b/scripts/build.ts index a434c73fd..ecf9e1645 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -1,8 +1,9 @@ +import { exec } from 'child_process'; import { build } from 'esbuild'; import { cp, readdir } from 'fs/promises'; import { argv } from 'process'; -const isDev = argv.includes('--dev'); +const isProduction = argv.includes('--production'); readdir('src/workers').then((workers) => { const files = [ @@ -46,3 +47,11 @@ readdir('node_modules/prisma').then((files) => .filter((file) => file.endsWith('.node')) .map((file) => cp(`node_modules/prisma/${file}`, `dist/bot/${file}`)), ); + +if (isProduction) { + // install fixed sharp + console.log('Installing fixed sharp...'); + exec('yarn init -y && yarn add sharp@0.33.1 --ignore-engines', { + cwd: 'dist/bot', + }); +}