From 40b17ac62dec2029e19bf56830701d25ade82d8c Mon Sep 17 00:00:00 2001 From: j2rong4cn <253551464@qq.com> Date: Sat, 26 Aug 2023 02:56:47 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8E=8B=E7=BC=A9?= =?UTF-8?q?=E3=80=81=E6=A0=A1=E9=AA=8C=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50d534a..ea5da8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,9 +17,18 @@ jobs: run: | cd node-proxy npm install && npm run build + - name: Compress + if: ${{ success() }} + run: | + cd node-proxy/build + ls -1 | xargs -I {} zip {}.zip {} && \ + ls -1 *.zip | xargs -I {} shasum -a 256 {} >> sha256.txt - name: Upload assets + if: ${{ success() }} uses: softprops/action-gh-release@v1 with: - files: node-proxy/build/* + files: | + node-proxy/build/*.zip + node-proxy/build/sha256.txt prerelease: false token: ${{ secrets.REPO_TOKEN }} From 7b6d6ef010ee6846b02ea3821d37153528b202bc Mon Sep 17 00:00:00 2001 From: j2rong4cn <253551464@qq.com> Date: Sat, 26 Aug 2023 02:57:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=97=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3235dc9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: build +on: + workflow_dispatch: + push: + paths: + - 'node-proxy/**' + +jobs: + release: + name: Build + runs-on: ubuntu-latest + steps: + - name: Setup Node.js + uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Build + run: | + cd node-proxy + npm install && npm run build + - name: Upload artifact + if: ${{ success() }} + uses: actions/upload-artifact@v3 + with: + name: alist-encrypt-dev + path: | + node-proxy/build/* From 1f6ab382bbcb397fe3006ecab1d9a837001613f0 Mon Sep 17 00:00:00 2001 From: j2rong4cn <253551464@qq.com> Date: Sat, 26 Aug 2023 03:03:00 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node-proxy/src/utils/levelDB.js | 5 ++--- node-proxy/webpack.config.ts | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/node-proxy/src/utils/levelDB.js b/node-proxy/src/utils/levelDB.js index a7d3343..baf8db0 100644 --- a/node-proxy/src/utils/levelDB.js +++ b/node-proxy/src/utils/levelDB.js @@ -2,11 +2,10 @@ import Datastore from 'nedb-promises' // let datastore = Datastore.create('/path/to/db.db') /** - * 继承接口,定义新方法 + * 封装新方法 */ -class Nedb extends Datastore { +class Nedb { constructor(dbFile) { - // this.super() this.datastore = Datastore.create(dbFile) } diff --git a/node-proxy/webpack.config.ts b/node-proxy/webpack.config.ts index 9cb0b5f..88192a2 100644 --- a/node-proxy/webpack.config.ts +++ b/node-proxy/webpack.config.ts @@ -46,7 +46,6 @@ export default () => { new PkgConfig(), ], target: 'node', - // externals: [nodeExternals()], mode: 'production', optimization: { minimize: true, @@ -80,14 +79,14 @@ export default () => { class PkgConfig { apply(compiler: webpack.Compiler) { - compiler.hooks.afterEmit.tap('DistConfig', () => { + compiler.hooks.afterEmit.tap('PkgConfig', () => { const conf = JSON.parse(fs.readFileSync(path.resolve('./package.json'), 'utf-8')) const pkg_conf = JSON.parse(fs.readFileSync(path.resolve('./pkgconfig.dist.json'), 'utf-8')) pkg_conf['name'] = conf['name'] pkg_conf['version'] = conf['version'] - const dist_conf_path = path.join(output.path, 'package.json') - fs.writeFileSync(dist_conf_path, JSON.stringify(pkg_conf), { encoding: 'utf-8' }) - console.log(dist_conf_path, pkg_conf) + const pkg_conf_path = path.join(output.path, 'package.json') + fs.writeFileSync(pkg_conf_path, JSON.stringify(pkg_conf), { encoding: 'utf-8' }) + console.log(pkg_conf_path, pkg_conf) }) } } From 09673cfd4383ca9220179b1879520d110bcf4983 Mon Sep 17 00:00:00 2001 From: j2rong4cn <253551464@qq.com> Date: Sat, 26 Aug 2023 03:16:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0.github/workflows/build.y?= =?UTF-8?q?ml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3235dc9..31864ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,11 @@ name: build on: workflow_dispatch: push: + branches: [ 'main' ] + paths: + - 'node-proxy/**' + pull_request: + branches: [ 'main' ] paths: - 'node-proxy/**'