summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-07-10 19:01:53 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-07-10 19:01:53 +0200
commitc22fe86c46299f13f44180ce2b652f57d5a4e794 (patch)
treeaba0fdd452ffb488cdaf4abe2cfc87ee10fe6e94
parent:wheelchair: use fs sync for backwards compatibility (diff)
downloadserver-c22fe86c46299f13f44180ce2b652f57d5a4e794.tar.xz
:sparkles: bundle exectuable
-rw-r--r--.github/workflows/release.yml40
-rw-r--r--.gitignore1
-rw-r--r--package-lock.json38
-rw-r--r--package.json7
-rw-r--r--src/Server.ts2
5 files changed, 68 insertions, 20 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644

index 00000000..893fd26c --- /dev/null +++ b/.github/workflows/release.yml
@@ -0,0 +1,40 @@ +on: + workflow_dispatch: + push: + # Sequence of patterns matched against refs/tags + tags: + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Publish Release + +jobs: + build: + name: Publish Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Build # This would actually build your project, using zip for an example artifact + run: | + npm install + npm run bundle + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: true + prerelease: true + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./build/api-linux + asset_name: server-api-linux + asset_content_type: application/x-binary diff --git a/.gitignore b/.gitignore
index 628444bf..85ddc5c8 100644 --- a/.gitignore +++ b/.gitignore
@@ -81,6 +81,7 @@ typings/ # Nuxt.js build / generate output .nuxt dist +build # Gatsby files .cache/ diff --git a/package-lock.json b/package-lock.json
index abc73d46..3abd61b4 100644 --- a/package-lock.json +++ b/package-lock.json
@@ -30,7 +30,7 @@ "i18next-node-fs-backend": "^2.1.3", "image-size": "^1.0.0", "jsonwebtoken": "^8.5.1", - "lambert-server": "^1.2.5", + "lambert-server": "^1.2.7", "missing-native-js-functions": "^1.2.6", "mongoose": "^5.12.3", "mongoose-autopopulate": "^0.12.3", @@ -43,7 +43,7 @@ "api": "dist/start.js" }, "devDependencies": { - "@types/bcrypt": "^3.0.0", + "@types/bcrypt": "^5.0.0", "@types/express": "^4.17.9", "@types/i18next-node-fs-backend": "^2.1.0", "@types/jsonwebtoken": "^8.5.0", @@ -1070,10 +1070,13 @@ } }, "node_modules/@types/bcrypt": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/bcrypt/-/bcrypt-3.0.1.tgz", - "integrity": "sha512-SwBrq5wb6jXP0o3O3jStdPWbKpimTImfdFD/OZE3uW+jhGpds/l5wMX9lfYOTDOa5Bod2QmOgo9ln+tMp2XP/w==", - "dev": true + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/bcrypt/-/bcrypt-5.0.0.tgz", + "integrity": "sha512-agtcFKaruL8TmcvqbndlqHPSJgsolhf/qPWchFlgnW1gECTN/nKbFcoFnvKAQRFfKbh+BO6A3SWdJu9t+xF3Lw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } }, "node_modules/@types/body-parser": { "version": "1.19.0", @@ -6142,9 +6145,9 @@ } }, "node_modules/lambert-server": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/lambert-server/-/lambert-server-1.2.5.tgz", - "integrity": "sha512-ZbbO15JgPgmqmSSFxsKVLwBCdEMv5V0OB3YfYzGSL+xIc+c3BpKKpVQDt2hdbvYYwrjrHtT9PWtdRIJj5cQ8SQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/lambert-server/-/lambert-server-1.2.7.tgz", + "integrity": "sha512-g2cMr5pY9dWORmLdt6Gro6ErqWk5gbOkmSXzGThiWbaAJ7MXup5QkuJHbW1OWeZVdfRg/mzY5qAM185q3TFQVQ==", "dependencies": { "body-parser": "^1.19.0", "express": "^4.17.1", @@ -11910,10 +11913,13 @@ } }, "@types/bcrypt": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/bcrypt/-/bcrypt-3.0.1.tgz", - "integrity": "sha512-SwBrq5wb6jXP0o3O3jStdPWbKpimTImfdFD/OZE3uW+jhGpds/l5wMX9lfYOTDOa5Bod2QmOgo9ln+tMp2XP/w==", - "dev": true + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/bcrypt/-/bcrypt-5.0.0.tgz", + "integrity": "sha512-agtcFKaruL8TmcvqbndlqHPSJgsolhf/qPWchFlgnW1gECTN/nKbFcoFnvKAQRFfKbh+BO6A3SWdJu9t+xF3Lw==", + "dev": true, + "requires": { + "@types/node": "*" + } }, "@types/body-parser": { "version": "1.19.0", @@ -16214,9 +16220,9 @@ } }, "lambert-server": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/lambert-server/-/lambert-server-1.2.5.tgz", - "integrity": "sha512-ZbbO15JgPgmqmSSFxsKVLwBCdEMv5V0OB3YfYzGSL+xIc+c3BpKKpVQDt2hdbvYYwrjrHtT9PWtdRIJj5cQ8SQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/lambert-server/-/lambert-server-1.2.7.tgz", + "integrity": "sha512-g2cMr5pY9dWORmLdt6Gro6ErqWk5gbOkmSXzGThiWbaAJ7MXup5QkuJHbW1OWeZVdfRg/mzY5qAM185q3TFQVQ==", "requires": { "body-parser": "^1.19.0", "express": "^4.17.1", diff --git a/package.json b/package.json
index b40459b1..84a71836 100644 --- a/package.json +++ b/package.json
@@ -11,7 +11,7 @@ "start": "npm run build && node dist/start", "build": "tsc -b .", "dev": "tsnd --respawn src/start.ts", - "bundle": "npm run build && pkg package.json" + "bundle": "npm run build && pkg --no-bytecode --public-packages=* package.json" }, "pkg": { "scripts": [ @@ -19,7 +19,8 @@ ], "assets": [ "locales", - "assets" + "assets", + "client_test" ], "targets": [ "latest-linux-x64", @@ -67,7 +68,7 @@ "i18next-node-fs-backend": "^2.1.3", "image-size": "^1.0.0", "jsonwebtoken": "^8.5.1", - "lambert-server": "^1.2.5", + "lambert-server": "^1.2.7", "missing-native-js-functions": "^1.2.6", "mongoose": "^5.12.3", "mongoose-autopopulate": "^0.12.3", diff --git a/src/Server.ts b/src/Server.ts
index 1a814f10..a1b51d21 100644 --- a/src/Server.ts +++ b/src/Server.ts
@@ -105,7 +105,7 @@ export class FosscordServer extends Server { app.use("/api/v9", prefix); this.app = app; this.app.use(ErrorHandler); - const indexHTML = await fs.readFile(path.join(__dirname, "..", "client_test", "index.html"), { encoding: "utf8" }); + const indexHTML = fs.readFileSync(path.join(__dirname, "..", "client_test", "index.html"), { encoding: "utf8" }); this.app.use("/assets", express.static(path.join(__dirname, "..", "assets")));