From 582d296cf90870f977abbf3291ec3e43f6fe2e5e Mon Sep 17 00:00:00 2001 From: msojocs Date: Mon, 6 Jun 2022 20:20:55 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=BB=98=E8=AE=A4=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E7=BA=AF=20Linux=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 14 +++++++------- changelog.md | 4 ++++ docker-compose.yml | 2 +- io.github.msojocs.wechat-devtools.yml | 2 +- readme.md | 4 +++- res/aur/PKGBUILD | 2 +- snap/snapcraft.yaml | 2 +- test/buid-deepin.sh | 4 ++-- test/reduce-wine | 2 +- tools/build-appimage.sh | 2 +- tools/build-deepin.sh | 6 +++--- tools/build-prepare.sh | 2 +- tools/build-tar.sh | 2 +- tools/fix-core.sh | 4 ++-- tools/fix-other.sh | 4 ++-- 15 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e4d22a..cc7f6ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: export DOCKER_UID=$UID export DOCKER_GID=$GID ls -l - export NO_WINE=false + export WINE=true docker-compose up - name: Compress Resources @@ -69,7 +69,7 @@ jobs: cd nwjs && ln -s node node.exe cd .. tar -zcf tmp/src/src-wine.tar.gz bin nwjs package.nw tools - export NO_WINE=true + export WINE=false "tools/fix-core.sh" "tools/fix-other.sh" tar -zcf tmp/src/src-no-wine.tar.gz bin nwjs package.nw tools @@ -142,14 +142,14 @@ jobs: - name: Build run: | - export NO_WINE=false + export WINE=true export ACTION_MODE=true # tar.gz AppImage ls -l mkdir -p tmp/build tools/build-prepare.sh tools/build-release.sh ${{ matrix.ARCH }} ${{ steps.tag.outputs.tag }} - export NO_WINE=true + export WINE=false tools/build-prepare.sh tools/build-release.sh ${{ matrix.ARCH }} ${{ steps.tag.outputs.tag }} @@ -209,10 +209,10 @@ jobs: ls -l mkdir -p tmp/build tools/build-prepare.sh - env NO_WINE=false tools/build-deepin.sh ${{ steps.tag.outputs.tag }} - export NO_WINE=true + env WINE=true tools/build-deepin.sh ${{ steps.tag.outputs.tag }} + export WINE=false tools/build-prepare.sh - env NO_WINE=true tools/build-deepin.sh ${{ steps.tag.outputs.tag }} + env WINE=false tools/build-deepin.sh ${{ steps.tag.outputs.tag }} - name: Upload artifact uses: actions/upload-artifact@v2.3.1 diff --git a/changelog.md b/changelog.md index d0e7cab..8a41457 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# 1.06.2206020-1 / 2022-06-03 + +- update: devtools to v1.06.2206020 + # 1.05.2204250-2 / 2022-05-11 - fix: 修复wcc编译器不支持单文件编译的bug(感谢 @2715851270 反馈) - fix: 修复cli异常 diff --git a/docker-compose.yml b/docker-compose.yml index 022116a..f4b31d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: environment: - ACTION_MODE=${ACTION_MODE:-false} # - https_proxy=${https_proxy:-} - - NO_WINE=${NO_WINE:-true} + - WINE=${WINE:-false} - LOCAL_USER_ID=${DOCKER_UID:-1000} - LOCAL_GROUP_ID=${DOCKER_GID:-1000} - BUILD_VERSION=${BUILD_VERSION:-v0} diff --git a/io.github.msojocs.wechat-devtools.yml b/io.github.msojocs.wechat-devtools.yml index 0ed7a13..0e46dc6 100644 --- a/io.github.msojocs.wechat-devtools.yml +++ b/io.github.msojocs.wechat-devtools.yml @@ -97,7 +97,7 @@ modules: - --share=network prepend-ld-library-path: /app/lib/x86_64-linux-gnu env: - - NO_WINE=true + - WINE=false sources: # - type: git # branch: dev diff --git a/readme.md b/readme.md index 0d88e5e..c8b9a1a 100644 --- a/readme.md +++ b/readme.md @@ -59,12 +59,14 @@ 在项目的 `bin` 目录中有 `wechat-devtools-cli` 脚本,是微信开发者工具的命令行支持 的Linux版本。相关资料可以在[微信CLI命令行V2](https://developers.weixin.qq.com/miniprogram/dev/devtools/cli.html)上找到。 # 使用方法 + 1. [在线安装](#在线安装) 2. 可以在本项目的[Release](https://github.com/msojocs/wechat-web-devtools-linux/releases)中,寻找已经构筑好了的软件包,下载使用。 如果`Release`版本存在问题,可以尝试[Continuous](https://github.com/msojocs/wechat-web-devtools-linux/releases/tag/continuous)版本,这是基于`master`分支的最新提交构建的,会及时修复一些 bug,但也可能会带来新的 bug。 3. 你可以 [自行构建](#自行构建) # 在线安装 + 目前支持以下平台: 1. [AUR](https://aur.archlinux.org/packages/wechat-devtools) @@ -74,7 +76,7 @@ # 自行构建 > 注: -> 如果想构建纯 Linux 版本,请添加环境变量:`export NO_WINE=true` +> 如果想构建 wine 版本,请添加环境变量:`export WINE=true` ## 方法0(推荐) diff --git a/res/aur/PKGBUILD b/res/aur/PKGBUILD index 4e0ddd4..4df506e 100644 --- a/res/aur/PKGBUILD +++ b/res/aur/PKGBUILD @@ -100,7 +100,7 @@ build() { export NW_VERSION=$_nwjs_ver # fix-package-name.js使用 export srcdir=$srcdir - export NO_WINE=true + export WINE=false for script in fix-package-name.js fix-cli.sh fix-other.sh fix-menu.sh fix-core.sh rebuild-node-modules.sh; do _log "run ${script}" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index bb4bba7..c7bba91 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -46,7 +46,7 @@ parts: build-environment: - PATH: "$SNAPCRAFT_STAGE/node/bin:$PATH" - NW_VERSION: 0.55.0 - - NO_WINE: 'true' + - WINE: 'false' # - NW_PACKAGE_DIR: "$SNAPCRAFT_PART_BUILD/code/package.nw" # - srcdir: "$SNAPCRAFT_PROJECT_DIR" build-packages: diff --git a/test/buid-deepin.sh b/test/buid-deepin.sh index dba9812..a2661aa 100644 --- a/test/buid-deepin.sh +++ b/test/buid-deepin.sh @@ -1,11 +1,11 @@ #!/bin/bash root_dir=$(cd `dirname $0`/.. && pwd -P) cd $root_dir -export NO_WINE=false +export WINE=true docker-compose up $root_dir/tools/build-deepin.sh $@ -export NO_WINE=true +export WINE=false $root_dir/tools/fix-core.sh $root_dir/tools/fix-other.sh $root_dir/tools/build-deepin.sh $@ \ No newline at end of file diff --git a/test/reduce-wine b/test/reduce-wine index 9d2ef87..bb4b512 100644 --- a/test/reduce-wine +++ b/test/reduce-wine @@ -1,5 +1,5 @@ #!/bin/bash -export NO_WINE=true +export WINE=fasle root_dir=$(cd `dirname $0`/.. && pwd -P) $root_dir/tools/fix-core.sh diff --git a/tools/build-appimage.sh b/tools/build-appimage.sh index 854d39c..d9ca28c 100755 --- a/tools/build-appimage.sh +++ b/tools/build-appimage.sh @@ -29,7 +29,7 @@ elif [[ $ARCH == '' ]];then exit 1 fi -if [[ $NO_WINE == 'true' ]];then +if [[ "$WINE" != 'true' ]];then TYPE='no_wine' else TYPE='wine' diff --git a/tools/build-deepin.sh b/tools/build-deepin.sh index 190cb0b..e08e4d6 100755 --- a/tools/build-deepin.sh +++ b/tools/build-deepin.sh @@ -31,7 +31,7 @@ fi ############ 准备构建deb包所需的文件及结构 ################ package_name="io.github.msojocs.wechat-devtools" -if [[ $NO_WINE == 'true' ]];then +if [[ "$WINE" != 'true' ]];then BUILD_MARK='no_wine' package_name="${package_name}-no-wine" else @@ -94,8 +94,8 @@ cd "$build_dir" ls -l "$build_dir" mkdir -p "$root_dir/tmp/build" -if [[ $NO_WINE != 'true' ]];then - echo "添加wine依赖 - $NO_WINE" +if [[ "$WINE" != 'false' ]];then + echo "添加wine依赖 - $WINE" echo "Depends: wine, wine-binfmt" >> "$build_dir/debian/control" fi diff --git a/tools/build-prepare.sh b/tools/build-prepare.sh index 5dc2349..eb7fde2 100755 --- a/tools/build-prepare.sh +++ b/tools/build-prepare.sh @@ -20,7 +20,7 @@ tmp_dir="$root_dir/tmp" store_dir="$tmp_dir/build" mkdir -p $store_dir rm -rf nwjs package.nw -if [[ $NO_WINE == 'true' ]];then +if [[ "$WINE" != 'true' ]];then tar -zxf wechat-devtools-*.src/src-no-wine.tar.gz -C . else tar -zxf wechat-devtools-*.src/src-wine.tar.gz -C . diff --git a/tools/build-tar.sh b/tools/build-tar.sh index 8e70f09..c4fb36d 100755 --- a/tools/build-tar.sh +++ b/tools/build-tar.sh @@ -37,7 +37,7 @@ elif [[ $ARCH == '' ]];then exit 1 fi -if [[ $NO_WINE == 'true' ]];then +if [[ "$WINE" != 'true' ]];then TYPE='no_wine' else TYPE='wine' diff --git a/tools/fix-core.sh b/tools/fix-core.sh index 1209d76..6338d86 100755 --- a/tools/fix-core.sh +++ b/tools/fix-core.sh @@ -42,8 +42,8 @@ if [[ ! -z $find_result ]];then sed -i "s#open -a Terminal \"\`pwd\`\"#$new_str#g" "$find_result" fi -# wcc、wcsc处理,设置NO_WINE=true环境变量生效 -if [[ $NO_WINE == 'true' ]];then +# wcc、wcsc处理,设置WINE=fasle环境变量生效 +if [[ "$WINE" != 'true' ]];then # "wcc.exe":!0,"wcsc.exe":!0 find_result=$( grep -lr '{wcc:!0,wcsc:!0}' "$tmp_dir/core.wxvpkg" ) echo "wcc: $find_result" diff --git a/tools/fix-other.sh b/tools/fix-other.sh index 5629465..3f87583 100755 --- a/tools/fix-other.sh +++ b/tools/fix-other.sh @@ -23,9 +23,9 @@ ls -l "${srcdir}/compiler" && chmod +x wcc/bin/linux/* ) -# 预览编译,设置NO_WINE=true环境变量生效 +# 预览编译,设置 WINE!=true 环境变量生效 # 如果是mac执行wcc,否则wcc.exe -if [[ $NO_WINE == 'true' ]];then +if [[ "$WINE" != 'true' ]];then \cp -rf "${srcdir}/compiler/generatemd5.js" "${package_dir}/js/vendor/generatemd5.js" \cp "${srcdir}/compiler/nodejs"/* "${package_dir}/js/vendor" cd "${package_dir}/js/vendor" && chmod 0755 wcc wcsc wcc.bin wcsc.bin