Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
NEXT_PUBLIC_SITE_URL=https://effront.gg

# Used only locally by scripts/upload-release.mjs, not by the app itself.
# Get this from the Vercel dashboard: Storage -> your Blob store -> .env.local tab
BLOB_READ_WRITE_TOKEN=

220 changes: 186 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"typecheck": "tsc --noEmit",
"format": "prettier --write .",
"format:check": "prettier --check .",
"prepare": "husky"
"prepare": "husky",
"release:upload": "node scripts/upload-release.mjs"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand All @@ -22,6 +23,7 @@
]
},
"dependencies": {
"@vercel/blob": "^1.1.1",
"next": "16.2.10",
"next-intl": "^4.13.1",
"react": "19.2.4",
Expand Down
28 changes: 28 additions & 0 deletions scripts/upload-release.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { put } from "@vercel/blob";
import { readFile } from "node:fs/promises";

const DEFAULT_PATHNAME = "stable/Arremate.rar";

const filePath = process.argv[2];
const blobPathname = process.argv[3] ?? DEFAULT_PATHNAME;

if (!filePath) {
console.error(
"Usage: node scripts/upload-release.mjs <path-to-file> [blob-pathname]",
);
console.error(
` blob-pathname defaults to "${DEFAULT_PATHNAME}"`,
);
process.exit(1);
}

const file = await readFile(filePath);

const blob = await put(blobPathname, file, {
access: "public",
addRandomSuffix: false,
allowOverwrite: true,
});

console.log("Uploaded:");
console.log(blob.url);
Loading
Loading