add node SEA

change build folder
This commit is contained in:
hzrd149 2025-03-24 21:44:40 +00:00
parent d87497e6c0
commit 638f798df1
9 changed files with 706 additions and 11 deletions

View File

@ -0,0 +1,5 @@
---
"nsite-gateway": minor
---
Change build folder

54
.github/workflows/node-sea.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: Build SEA
on:
push:
branches:
- master
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
sea-action:
name: Build SEA
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install Dependencies
run: pnpm install
- name: Build and bundle
run: pnpm build && pnpm bundle
- name: Find Node
id: find-node
run: echo "node=$(node -e 'console.log(process.argv[0]);')" >>
$env:GITHUB_OUTPUT
- name: SEA
id: sea
uses: bryopsida/node-sea-action@v1
with:
working-dir: .
output-dir: build/release
executable-name: nsite-gateway
sea-config-path: sea-config.json
node-path: ${{ steps.find-node.outputs.node }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-sea
path: build/release
if-no-files-found: error

View File

@ -18,10 +18,10 @@ jobs:
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
- name: Setup Node.js 20 - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version-file: .nvmrc
cache: "pnpm" cache: "pnpm"
- name: Install Dependencies - name: Install Dependencies

View File

@ -26,10 +26,10 @@ jobs:
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
- name: Setup Node.js 20 - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version-file: .nvmrc
cache: "pnpm" cache: "pnpm"
- name: Install Dependencies - name: Install Dependencies

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ build
data data
.netrc .netrc
screenshots screenshots
dist

View File

@ -2,20 +2,21 @@
"name": "nsite-gateway", "name": "nsite-gateway",
"version": "0.7.0", "version": "0.7.0",
"description": "A blossom server implementation written in Typescript", "description": "A blossom server implementation written in Typescript",
"main": "build/index.js", "main": "dist/index.js",
"type": "module", "type": "module",
"author": "hzrd149", "author": "hzrd149",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"start": "node build/index.js", "start": "node dist/index.js",
"prepack": "tsc", "prepack": "tsc",
"build": "tsc", "build": "tsc",
"dev": "nodemon -i '**/data/**' --exec 'node' --loader @swc-node/register/esm src/index.ts", "dev": "nodemon -i '**/data/**' --exec 'node' --loader @swc-node/register/esm src/index.ts",
"bundle": "esbuild --bundle dist/index.js --format=esm --platform=node --outfile=build/bundle.mjs",
"format": "prettier -w ." "format": "prettier -w ."
}, },
"bin": "build/index.js", "bin": "dist/index.js",
"files": [ "files": [
"build", "dist",
"public" "public"
], ],
"dependencies": { "dependencies": {
@ -57,7 +58,9 @@
"@types/node": "^20.17.24", "@types/node": "^20.17.24",
"@types/proxy-from-env": "^1.0.4", "@types/proxy-from-env": "^1.0.4",
"@types/ws": "^8.18.0", "@types/ws": "^8.18.0",
"esbuild": "^0.25.1",
"nodemon": "^3.1.9", "nodemon": "^3.1.9",
"pkg": "^5.8.1",
"prettier": "^3.5.3", "prettier": "^3.5.3",
"typescript": "^5.8.2" "typescript": "^5.8.2"
}, },

631
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

5
sea-config.json Normal file
View File

@ -0,0 +1,5 @@
{
"main": "build/bundle.mjs",
"output": "build/nsite-gateway.blob",
"assets": []
}

View File

@ -3,7 +3,7 @@
"module": "NodeNext", "module": "NodeNext",
"target": "es2020", "target": "es2020",
"moduleResolution": "NodeNext", "moduleResolution": "NodeNext",
"outDir": "build", "outDir": "dist",
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
"sourceMap": true "sourceMap": true