From afe64f904267f27e7a26d989752bca2aa925639a Mon Sep 17 00:00:00 2001 From: msojocs Date: Tue, 12 Apr 2022 17:02:05 +0800 Subject: [PATCH 1/3] Squashed commit of the following: commit e1ef2b7754aa038301c6867ab7f7b459b703dee5 Author: msojocs Date: Tue Apr 12 17:01:24 2022 +0800 update: deb build commit 907afc6c7d8690951fd7eefe24bfc868d63e51a8 Author: msojocs Date: Tue Apr 12 16:31:19 2022 +0800 add: gpg import commit 1a6fb9e6115ae891d3dcd0cc3d2c35fc63c92ed7 Author: msojocs Date: Tue Apr 12 12:53:43 2022 +0800 update: readme & deb --- .github/workflows/release.yml | 9 +++++++-- readme.md | 6 ++++-- tools/build-deepin.sh | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6dfe2d3..2e3995c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -230,8 +230,13 @@ jobs: echo "tag result: $tag - $name" echo "::set-output name=tag::$tag" echo "::set-output name=name::$name" - - - name: Build Deepin Package + # https://stackoverflow.com/questions/61096521/how-to-use-gpg-key-in-github-actions + - name: Configure GPG Key + run: | + echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import + env: + GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} + - name: Build Deb Package run: | sudo apt-get install -y build-essential fakeroot devscripts git git-buildpackage debhelper debmake lintian pbuilder export BUILD_VERSION=${{ steps.tag.outputs.tag }} diff --git a/readme.md b/readme.md index d1ece07..39527f0 100644 --- a/readme.md +++ b/readme.md @@ -11,8 +11,8 @@ [![Node.js CI](https://github.com/msojocs/wechat-devtools-linux/actions/workflows/release.yml/badge.svg)](https://github.com/msojocs/wechat-devtools-linux/actions/workflows/release.yml) [![wechat-tools](https://img.shields.io/badge/wechat--devtools-1.05.2203070-yellow)](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) -[![nwjs](https://img.shields.io/badge/nwjs-0.53.1-green)](https://nwjs.io/downloads/) -[![node](https://img.shields.io/badge/node-16.1.0-orange)](https://nodejs.org/en/) +[![nwjs](https://img.shields.io/badge/nwjs-0.55.0-green)](https://nwjs.io/downloads/) +[![node](https://img.shields.io/badge/node-16.4.2-orange)](https://nodejs.org/en/) [![node](https://img.shields.io/badge/aur-1.05.2203070-blue)](https://aur.archlinux.org/packages/wechat-devtools) 这是微信开发者工具 Linux版 @@ -152,3 +152,5 @@ git clone https://github.com/msojocs/wechat-devtools-linux.git 3. . 4. IvesSSa 5. icepie + 6. zyk-miao + 7. Starrah diff --git a/tools/build-deepin.sh b/tools/build-deepin.sh index 3e33b86..2db4f48 100755 --- a/tools/build-deepin.sh +++ b/tools/build-deepin.sh @@ -98,5 +98,5 @@ if [[ $NO_WINE != 'true' ]];then echo "Depends: wine, wine-binfmt" >> "$build_dir/debian/control" fi -debuild --no-tgz-check -i -I -b -us -uc +debuild --no-tgz-check -i -I mv $tmp_dir/*.deb $tmp_dir/build \ No newline at end of file From 6ebac53707a331680e43b2ae7651b5ae9a371230 Mon Sep 17 00:00:00 2001 From: msojocs Date: Tue, 12 Apr 2022 23:01:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update:=20=E4=BC=98=E5=8C=96cli=20update:?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/wechat-devtools | 8 +++++++- bin/wechat-devtools-cli | 27 ++++++--------------------- test/buid-deepin.sh | 11 +++++++++++ tools/wechat-devtools-cli | 3 --- 4 files changed, 24 insertions(+), 25 deletions(-) create mode 100644 test/buid-deepin.sh delete mode 100755 tools/wechat-devtools-cli diff --git a/bin/wechat-devtools b/bin/wechat-devtools index 32bf9a9..7944a8d 100755 --- a/bin/wechat-devtools +++ b/bin/wechat-devtools @@ -1,6 +1,12 @@ #!/bin/bash -root_dir=$(cd `dirname $0`/.. && pwd -P) +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +root_dir="$( cd -P "$( dirname "$SOURCE" )"/.. >/dev/null 2>&1 && pwd )" # 数据目录处理 if [ -z $XDG_CONFIG_HOME ];then diff --git a/bin/wechat-devtools-cli b/bin/wechat-devtools-cli index 155e5bb..097b8c6 100755 --- a/bin/wechat-devtools-cli +++ b/bin/wechat-devtools-cli @@ -6,27 +6,12 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done -DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" +root_dir="$( cd -P "$( dirname "$SOURCE" )"/.. >/dev/null 2>&1 && pwd )" -cd $DIR/.. +cd $root_dir -export WECHAT_DEVTOOLS_DIR="$DIR/../nwjs" -export APPDATA="$DIR/../nwjs" -export PATH="$DIR/../wine:$DIR/../node/bin:$DIR/../nwjs:$PATH" +export WECHAT_DEVTOOLS_DIR="$root_dir/nwjs" +export APPDATA="$root_dir/nwjs" +export PATH="$root_dir/wine:$root_dir/node/bin:$root_dir/nwjs:$PATH" -$DIR/../tools/wechat-devtools-cli "$@" - -# #!/bin/bash -# root_dir=$(cd `dirname $0`/.. && pwd -P) - -# echo "cli" - -# export WECHAT_DEVTOOLS_DIR="$root_dir/nwjs" -# export APPDATA="$HOME/.config" -# export USERPROFILE="$root" -# export PATH="$root_dir/wine:$root_dir/node/bin:$root_dir/nwjs:$PATH" -# export CALLING_DIR=$root_dir - -# node $root_dir/bin/cli.js "$@" - -# cd $root_dir \ No newline at end of file +node $root_dir/package.nw/js/common/cli/index.js "$@" diff --git a/test/buid-deepin.sh b/test/buid-deepin.sh new file mode 100644 index 0000000..dba9812 --- /dev/null +++ b/test/buid-deepin.sh @@ -0,0 +1,11 @@ +#!/bin/bash +root_dir=$(cd `dirname $0`/.. && pwd -P) +cd $root_dir +export NO_WINE=false +docker-compose up +$root_dir/tools/build-deepin.sh $@ + +export NO_WINE=true +$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/tools/wechat-devtools-cli b/tools/wechat-devtools-cli deleted file mode 100755 index f063d05..0000000 --- a/tools/wechat-devtools-cli +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node - -require("../nwjs/package.nw/js/common/cli/index.js"); From 648ea43aa559a0322fc313fbdc8acdb8acaacfcd Mon Sep 17 00:00:00 2001 From: msojocs Date: Tue, 12 Apr 2022 23:08:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?update:=20=E8=B7=9F=E8=BF=9Baur=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- res/aur/PKGBUILD | 9 ++++++++- tools/build-aur.sh | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/res/aur/PKGBUILD b/res/aur/PKGBUILD index 2ca5bd7..b969cf7 100644 --- a/res/aur/PKGBUILD +++ b/res/aur/PKGBUILD @@ -36,6 +36,7 @@ source=("nwjs-v${_nwjs_ver}.tar.gz::https://npm.taobao.org/mirrors/nwjs/v${_nwjs "wechat-devtools.desktop" "logo.svg" "wechat-devtools" + "wechat-devtools-cli" "fix-cli.sh" "fix-menu.sh" "fix-core.sh" @@ -58,6 +59,7 @@ md5sums=(ac7680788544c457daee11aaf69798fe # nwjs "SKIP" "SKIP" "SKIP" + "SKIP" "SKIP") options=('!strip') @@ -85,6 +87,7 @@ build() { # prepare nw-gyp _log "prepare nw-gyp" + node --version npm uninstall node-gyp -g npm install nw-gyp node-gyp -g @@ -93,6 +96,7 @@ build() { cp "$(which node)" "${srcdir}/node.${_node_version}" # run fix scripts + export NW_PACKAGE_DIR="${srcdir}/package.nw" export NW_VERSION=$_nwjs_ver # fix-package-name.js使用 export srcdir=$srcdir @@ -110,7 +114,6 @@ build() { package() { mkdir -p "${pkgdir}${_install_dir}" cd "${pkgdir}${_install_dir}" - mkdir -p bin cp -r "${srcdir}/nwjs" . cp -r "${srcdir}/package.nw" . @@ -120,6 +123,10 @@ package() { cd nwjs && ln -s node node.exe install -Dm755 "${srcdir}/wechat-devtools" "${pkgdir}${_install_dir}/bin/wechat-devtools" + install -Dm755 "${srcdir}/wechat-devtools-cli" "${pkgdir}${_install_dir}/bin/wechat-devtools-cli" install -Dm644 "${srcdir}/wechat-devtools.desktop" "${pkgdir}/usr/share/applications/wechat-devtools.desktop" install -Dm644 "${srcdir}/logo.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/wechat-devtools.svg" + mkdir -p "${pkgdir}/usr/bin" + ln -s "${_install_dir}/bin/wechat-devtools" "${pkgdir}/usr/bin/wechat-devtools" + ln -s "${_install_dir}/bin/wechat-devtools-cli" "${pkgdir}/usr/bin/wechat-devtools-cli" } diff --git a/tools/build-aur.sh b/tools/build-aur.sh index 79d59bc..1bb74ea 100755 --- a/tools/build-aur.sh +++ b/tools/build-aur.sh @@ -56,6 +56,7 @@ COMPILER_MD5=$( md5sum tmp/compiler.tar.gz | cut -d ' ' -f1 ) rm -rf $build_dir mkdir -p $build_dir cp "$root_dir/bin/wechat-devtools" "$build_dir" +cp "$root_dir/bin/wechat-devtools-cli" "$build_dir" cp "$root_dir/tools"/*.sh "$build_dir" cp "$root_dir/tools"/*.js "$build_dir" cp "$root_dir/res/aur"/* "$build_dir"