From 2b4d3ef088303248fc433bf9ec1b1a1cbe95c38e Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sat, 24 Dec 2022 11:21:20 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0git=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pake_build.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 7dbd21f..aac097d 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -78,9 +78,15 @@ jobs: # files: | # output/*/*.* - - uses: ncipollo/release-action@v1 - if: startsWith(github.ref, 'refs/tags/v') - with: - allowUpdates: true - artifacts: "output/*/*.*" - token: ${{ secrets.GITHUB_TOKEN }} + # - uses: ncipollo/release-action@v1 + # if: startsWith(github.ref, 'refs/tags/v') + # with: + # allowUpdates: true + # artifacts: "output/*/*.*" + # token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload files + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh + bash upload.sh output/*/*.* From 3da780f33a772ca988159af3f72175a5a27e7fc9 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sat, 24 Dec 2022 12:11:07 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Linux=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=8C=85=E5=90=8D=E6=AD=A3=E5=88=99=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/builders/common.ts | 11 +++++++++++ dist/cli.js | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/bin/builders/common.ts b/bin/builders/common.ts index b081e35..d2819d8 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -37,6 +37,17 @@ export async function mergeTauriConfig( transparent, resizable, }; + // Package name is valid ? + // for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other + if (process.platform === "linux") { + const reg = new RegExp("/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/"); + if (!reg.test(name)) { + logger.error("package name is illegal, it must be lowercase, numbers, dashes.") + logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read"); + process.exit(); + } + } + Object.assign(tauriConf.tauri.windows[0], { url, ...tauriConfWindowOptions }); tauriConf.package.productName = name; diff --git a/dist/cli.js b/dist/cli.js index 0415c56..09f4e5b 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1632,6 +1632,16 @@ function mergeTauriConfig(url, options, tauriConf) { transparent, resizable, }; + // Package name is valid ? + // for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other + if (process.platform === "linux") { + const reg = new RegExp("/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/"); + if (!reg.test(name)) { + logger.error("package name is illegal, it must be lowercase, numbers, dashes."); + logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read"); + process.exit(); + } + } Object.assign(tauriConf.tauri.windows[0], Object.assign({ url }, tauriConfWindowOptions)); tauriConf.package.productName = name; tauriConf.tauri.bundle.identifier = identifier; @@ -2209,7 +2219,7 @@ var scripts = { tauri: "tauri", cli: "rollup -c rollup.config.js --watch", "cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js", - "cli:publish": "npm run cli:build && npm publish" + prepublishOnly: "npm run cli:build" }; var type = "module"; var exports = "./dist/pake.js"; From fbe9d7b01f07b9cf1be693fbad30694115f8e417 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sat, 24 Dec 2022 12:14:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Linux=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=8C=85=E5=90=8D=E6=AD=A3=E5=88=99=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/builders/common.ts | 2 +- dist/cli.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/builders/common.ts b/bin/builders/common.ts index d2819d8..47e060e 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -40,7 +40,7 @@ export async function mergeTauriConfig( // Package name is valid ? // for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other if (process.platform === "linux") { - const reg = new RegExp("/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/"); + const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/); if (!reg.test(name)) { logger.error("package name is illegal, it must be lowercase, numbers, dashes.") logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read"); diff --git a/dist/cli.js b/dist/cli.js index 09f4e5b..3b4b3ce 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1635,7 +1635,7 @@ function mergeTauriConfig(url, options, tauriConf) { // Package name is valid ? // for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other if (process.platform === "linux") { - const reg = new RegExp("/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/"); + const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/); if (!reg.test(name)) { logger.error("package name is illegal, it must be lowercase, numbers, dashes."); logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read"); From 59a605b087163db2b54880dcd5d999423b2e1183 Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sat, 24 Dec 2022 12:30:18 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Linux=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=8C=85=E5=90=8D=E6=AD=A3=E5=88=99=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/builders/common.ts | 2 +- dist/cli.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/builders/common.ts b/bin/builders/common.ts index 47e060e..1ce9cfc 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -41,7 +41,7 @@ export async function mergeTauriConfig( // for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other if (process.platform === "linux") { const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/); - if (!reg.test(name)) { + if (!reg.test(name) || reg.exec(name)[0].length != name.length) { logger.error("package name is illegal, it must be lowercase, numbers, dashes.") logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read"); process.exit(); diff --git a/dist/cli.js b/dist/cli.js index 3b4b3ce..a0676a6 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1636,7 +1636,7 @@ function mergeTauriConfig(url, options, tauriConf) { // for Linux, package name must be a-z, 0-9 or "-", not allow to A-Z and other if (process.platform === "linux") { const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/); - if (!reg.test(name)) { + if (!reg.test(name) || reg.exec(name)[0].length != name.length) { logger.error("package name is illegal, it must be lowercase, numbers, dashes."); logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read"); process.exit(); From 32f968b992867824e916a3428daa5d782ba1676e Mon Sep 17 00:00:00 2001 From: Tlntin Date: Sat, 24 Dec 2022 12:49:20 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Windows,Mac=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=8C=85=E5=90=8D=E6=AD=A3=E5=88=99=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/builders/common.ts | 10 +++++++++- dist/cli.js | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bin/builders/common.ts b/bin/builders/common.ts index 1ce9cfc..06b2d19 100644 --- a/bin/builders/common.ts +++ b/bin/builders/common.ts @@ -42,11 +42,19 @@ export async function mergeTauriConfig( if (process.platform === "linux") { const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/); if (!reg.test(name) || reg.exec(name)[0].length != name.length) { - logger.error("package name is illegal, it must be lowercase, numbers, dashes.") + logger.error("package name is illegal, it must be lowercase letters, numbers, dashes, and it must contain the lowercase letters.") logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read"); process.exit(); } } + if (process.platform === "win32" || process.platform === "darwin" ) { + const reg = new RegExp(/([0-9]*[a-zA-Z]+[0-9]*)+/); + if (!reg.test(name) || reg.exec(name)[0].length != name.length) { + logger.error("package name is illegal, it must be letters, numbers, and it must contain the letters") + logger.error("E.g 123pan,123Pan Pan123,weread, WeRead, WERead"); + process.exit(); + } + } Object.assign(tauriConf.tauri.windows[0], { url, ...tauriConfWindowOptions }); diff --git a/dist/cli.js b/dist/cli.js index a0676a6..468a13b 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -1637,11 +1637,19 @@ function mergeTauriConfig(url, options, tauriConf) { if (process.platform === "linux") { const reg = new RegExp(/[0-9]*[a-z]+[0-9]*\-?[0-9]*[a-z]*[0-9]*\-?[0-9]*[a-z]*[0-9]*/); if (!reg.test(name) || reg.exec(name)[0].length != name.length) { - logger.error("package name is illegal, it must be lowercase, numbers, dashes."); + logger.error("package name is illegal, it must be lowercase letters, numbers, dashes, and it must contain the lowercase letters."); logger.error("E.g com-123-xxx, 123pan, pan123,weread, we-read"); process.exit(); } } + if (process.platform === "win32" || process.platform === "darwin") { + const reg = new RegExp(/([0-9]*[a-zA-Z]+[0-9]*)+/); + if (!reg.test(name) || reg.exec(name)[0].length != name.length) { + logger.error("package name is illegal, it must be letters, numbers, and it must contain the letters"); + logger.error("E.g 123pan,123Pan Pan123,weread, WeRead, WERead"); + process.exit(); + } + } Object.assign(tauriConf.tauri.windows[0], Object.assign({ url }, tauriConfWindowOptions)); tauriConf.package.productName = name; tauriConf.tauri.bundle.identifier = identifier;