perf: remove snap

This commit is contained in:
msojocs 2023-06-03 17:09:45 +08:00
parent baf4206157
commit 7a302f6c12
7 changed files with 2 additions and 639 deletions

View File

@ -202,124 +202,6 @@ jobs:
name: wechat-devtools-${{ matrix.ARCH }}.build
path: tmp/build
# build-arch:
# name: Build ArchLinux Package
# runs-on: ubuntu-latest
# timeout-minutes: 30
# strategy:
# matrix:
# node-version: [16.x]
# ARCH: ['x86_64']
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: 'recursive'
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v2
# with:
# node-version: ${{ matrix.node-version }}
# cache: 'npm'
# - name: Prepare
# run: |
# cd compiler && npm install
# npm install node-gyp nw-gyp npm -g
# node-gyp install
# cat /etc/passwd
# - name: Generate TAG
# id: Tag
# run: |
# tag='continuous'
# name='Continuous Build'
# if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
# tag='${{ github.ref_name }}'
# name='${{ github.ref_name }}'
# fi
# echo "tag result: $tag - $name"
# echo "::set-output name=tag::$tag"
# echo "::set-output name=name::$name"
# - name: Build ArchLinux Package
# uses: countstarlight/arch-makepkg-action@master
# env:
# BUILD_VERSION: ${{ steps.tag.outputs.tag }}
# WINE: true
# with:
# repos: >
# archlinuxcn=https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
# before: "tools/build-aur.sh && sudo pacman -S --noconfirm archlinuxcn-keyring"
# packages: >
# gconf
# p7zip
# libxkbfile
# python2
# openssl
# gcc
# make
# libssh2
# krb5
# wget
# scripts: "cd tmp/AUR && makepkg && ls -l && cd ../../"
# - name: Fix Permissions
# run: |
# sudo chmod -R 0777 tmp
# mkdir -p tmp/build
# mv tmp/AUR/*.pkg.* tmp/build
# cd tmp/build
# for file in `ls *.pkg.*`;do mv $file `echo $file|sed 's/:/-/g'`;done;
# ls -l
# - name: Upload artifact
# uses: actions/upload-artifact@v2.3.1
# with:
# # Artifact name
# name: wechat-devtools-${{ matrix.ARCH }}.build
# path: tmp/build
# build-snap:
# name: Build Snap Package
# runs-on: ubuntu-18.04
# timeout-minutes: 30
# strategy:
# matrix:
# node-version: [16.x]
# ARCH: ['x86_64']
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: 'recursive'
# - name: Install Snapcraft
# uses: samuelmeuli/action-snapcraft@v1
# with:
# use_lxd: true
# - name: Prepare
# run: |
# cd compiler && npm install
# git --version
# git --help
# # You can now run Snapcraft shell commands
# - name: Build snap
# run: sg lxd -c 'snapcraft --use-lxd'
# - name: move file
# run: |
# mkdir -p tmp/build
# mv *.snap tmp/build
# - name: Upload artifact
# uses: actions/upload-artifact@v2.3.1
# with:
# # Artifact name
# name: wechat-devtools-${{ matrix.ARCH }}.build
# path: tmp/build
upload:
name: Create release and upload artifacts
needs:
@ -355,7 +237,7 @@ jobs:
sudo apt install -y fuse
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage **build/WeChat*.AppImage **build/*.tar.gz **build/*.deb # **build/*.pkg.* **build/*.snap
./pyuploadtool-x86_64.AppImage **build/WeChat*.AppImage **build/*.tar.gz **build/*.deb
- name: Release
uses: softprops/action-gh-release@v1
@ -369,5 +251,3 @@ jobs:
**build/WeChat*.AppImage
**build/*.tar.gz
**build/*.deb
# **build/*.pkg.*
# **build/*.snap

View File

@ -213,123 +213,6 @@ jobs:
name: wechat-devtools-${{ matrix.ARCH }}.build
path: tmp/build
# build-arch:
# name: Build ArchLinux Package
# runs-on: ubuntu-latest
# timeout-minutes: 30
# strategy:
# matrix:
# node-version: [16.x]
# ARCH: ['x86_64']
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: 'recursive'
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v2
# with:
# node-version: ${{ matrix.node-version }}
# cache: 'npm'
# - name: Prepare
# run: |
# cd compiler && npm install
# npm install node-gyp nw-gyp npm -g
# node-gyp install
# cat /etc/passwd
# - name: Generate TAG
# id: Tag
# run: |
# tag='continuous'
# name='Continuous Build'
# if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
# tag='${{ github.ref_name }}'
# name='${{ github.ref_name }}'
# fi
# echo "tag result: $tag - $name"
# echo "::set-output name=tag::$tag"
# echo "::set-output name=name::$name"
# - name: Build ArchLinux Package
# uses: countstarlight/arch-makepkg-action@master
# env:
# BUILD_VERSION: ${{ steps.tag.outputs.tag }}
# with:
# repos: >
# archlinuxcn=https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
# before: "tools/build-aur.sh && sudo pacman -S --noconfirm archlinuxcn-keyring"
# packages: >
# gconf
# p7zip
# libxkbfile
# python2
# openssl
# gcc
# make
# libssh2
# krb5
# wget
# scripts: "cd tmp/AUR && makepkg && ls -l && cd ../../"
# - name: Fix Permissions
# run: |
# sudo chmod -R 0777 tmp
# mkdir -p tmp/build
# mv tmp/AUR/*.pkg.* tmp/build
# cd tmp/build
# for file in `ls *.pkg.*`;do mv $file `echo $file|sed 's/:/-/g'`;done;
# ls -l
# - name: Upload artifact
# uses: actions/upload-artifact@v2.3.1
# with:
# # Artifact name
# name: wechat-devtools-${{ matrix.ARCH }}.build
# path: tmp/build
# build-snap:
# name: Build Snap Package
# runs-on: ubuntu-18.04
# timeout-minutes: 30
# strategy:
# matrix:
# node-version: [16.x]
# ARCH: ['x86_64']
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: 'recursive'
# - name: Install Snapcraft
# uses: samuelmeuli/action-snapcraft@v1
# with:
# use_lxd: true
# - name: Prepare
# run: |
# cd compiler && npm install
# git --version
# git --help
# # You can now run Snapcraft shell commands
# - name: Build snap
# run: sg lxd -c 'snapcraft --use-lxd'
# - name: move file
# run: |
# mkdir -p tmp/build
# mv *.snap tmp/build
# - name: Upload artifact
# uses: actions/upload-artifact@v2.3.1
# with:
# # Artifact name
# name: wechat-devtools-${{ matrix.ARCH }}.build
# path: tmp/build
upload:
name: Create release and upload artifacts
needs:
@ -365,7 +248,7 @@ jobs:
sudo apt install -y fuse
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage **build/WeChat*.AppImage **build/*.tar.gz **build/*.deb # **build/*.pkg.* **build/*.snap
./pyuploadtool-x86_64.AppImage **build/WeChat*.AppImage **build/*.tar.gz **build/*.deb
- name: Release
uses: softprops/action-gh-release@v1
@ -379,5 +262,3 @@ jobs:
**build/WeChat*.AppImage
**build/*.tar.gz
**build/*.deb
# **build/*.pkg.*
# **build/*.snap

View File

@ -1,183 +0,0 @@
app-id: io.github.msojocs.wechat-devtools
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.node12
command: startup
finish-args:
# X11 + XShm access
- --share=ipc
- --socket=x11
# Wayland access
- --socket=wayland
# Needs to talk to the network:
- --share=network
# Needs to save files locally
- --filesystem=host
- --metadata=X-DConf=migrate-path=/io/github/msojocs/wechat-devtools
modules:
- name: nwjs
buildsystem: simple
sources:
- type: archive
url: http://npmmirror.com/mirrors/nwjs/v0.55.0/nwjs-sdk-v0.55.0-linux-x64.tar.gz
md5: ac7680788544c457daee11aaf69798fe
build-commands:
- ls -l
- mkdir -p /app/opt/nwjs
- mv * /app/opt/nwjs
- name: package.nw
buildsystem: simple
sources:
- type: archive
url: https://servicewechat.com/wxa-dev-logic/download_redirect?type=x64&from=mpwiki&download_version=1062207210&version_type=1
md5: 7599cfeeebb57bda7ae5594daf2e0659
archive-type: 7z
path: code
strip-components: 0
dest-filename: wechat_devtools.7z
build-commands:
- ls -l
- mv code/package.nw /app/opt/package.nw
- name: nodejs
buildsystem: simple
build-options:
prepend-path: /app/opt/nodejs/bin
build-args:
- --share=network
sources:
- type: archive
url: https://npmmirror.com/mirrors/node/v16.1.0/node-v16.1.0-linux-x64.tar.gz
md5: 2280bfbbf29981fd5adce334f40146ff
build-commands:
- ls -l
- mkdir -p /app/opt/nodejs
- mv * /app/opt/nodejs
- npm config set registry https://registry.npmmirror.com # 注册模块镜像
- npm config set disturl https://npmmirror.com/dist # node-gyp 编译依赖的 node 源码镜像
- npm install -g npm@8.6.0
- npm --version
- npm -g install nw-gyp node-gyp
- name: library
buildsystem: simple
build-commands:
- for file in *.deb; do ar p $file data.tar.xz | tar -xJ; done;
post-install:
- rm -rf usr/share/{doc,man}
- cp -dr usr/* $FLATPAK_DEST/
# - cp -dr lib/* $FLATPAK_DEST/lib
# - cp -dr opt/* $FLATPAK_DEST/
sources:
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/libkrb5-dev_1.18.3-6+deb11u1_amd64.deb
sha256: d3a4a4705329c51d7a9843a72f87421938eeeef8548b3f2d46ce83f0862f9311
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/krb5-multidev_1.18.3-6+deb11u1_amd64.deb
sha256: b8bbee0879e6041ebbf58f62e1a526cc25225d67c140d5593b1341cc31388351
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/libkrb5-3_1.18.3-6+deb11u1_amd64.deb
sha256: afb9dced3fcbdbc439a166eaa217dbfd485585842f12ce4587123009618e8bfe
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/libk5crypto3_1.18.3-6+deb11u1_amd64.deb
sha256: 4a010fc69322b6be9e141a76593f46e6588c968ee3b7cf79a3b8b7efda9aeeba
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/libgssapi-krb5-2_1.18.3-6+deb11u1_amd64.deb
sha256: 2ab853cbd0494c06fa694906c6eeea4df79720f461c76d080eb21a3e98f44115
- name: build
buildsystem: simple
build-options:
ldflags: -L/app/lib/x86_64-linux-gnu
prepend-path: /app/opt/nodejs/bin:/usr/lib/sdk/node12/bin
build-args:
- --share=network
prepend-ld-library-path: /app/lib/x86_64-linux-gnu
env:
- WINE=false
sources:
# - type: git
# branch: dev
# url: https://github.com/msojocs/wechat-web-devtools-linux.git
- type: dir
path: tools
dest: tools
- type: dir
path: compiler
dest: compiler
build-commands:
# - ln -s /app/opt/package.nw package.nw
- cp -r /app/opt/package.nw .
- cd package.nw && ls -l
- python --version
- python3 --version
- python2 --version
- node --version
- tools/fix-package-name.js
- tools/fix-selection-copy-node
- tools/fix-cli.sh
- tools/fix-core.sh
- tools/fix-menu.sh
- tools/fix-other.sh
- tools/rebuild-node-modules.sh 0.55.0
# - ls -l
post-install:
- rm -rf /app/opt/package.nw
- cp -r package.nw /app/opt
- name: library
buildsystem: simple
build-commands:
- for file in *.deb; do ar p $file data.tar.xz | tar -xJ; done;
post-install:
- rm -rf usr/share/{doc,man}
- cp -dr usr/* $FLATPAK_DEST/
- cp -dr lib/* $FLATPAK_DEST/lib
# - cp -dr opt/* $FLATPAK_DEST/
sources:
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/libgssapi-krb5-2_1.18.3-6+deb11u1_amd64.deb
sha256: 2ab853cbd0494c06fa694906c6eeea4df79720f461c76d080eb21a3e98f44115
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/libkrb5-3_1.18.3-6+deb11u1_amd64.deb
sha256: afb9dced3fcbdbc439a166eaa217dbfd485585842f12ce4587123009618e8bfe
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/libk5crypto3_1.18.3-6+deb11u1_amd64.deb
sha256: 4a010fc69322b6be9e141a76593f46e6588c968ee3b7cf79a3b8b7efda9aeeba
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/krb5/libkrb5support0_1.18.3-6+deb11u1_amd64.deb
sha256: 1f19908dbd37bd2ba9b3b3c9eb6ab8bee9a72f72745e6887f5366bb5fece654b
- type: file
url: http://ftp.cn.debian.org/debian/pool/main/k/keyutils/libkeyutils1_1.6.1-2_amd64.deb
sha256: f01060b434d8cad3c58d5811d2082389f11b3db8152657d6c22c1d298953f2a5
- name: clean
buildsystem: simple
build-commands:
- cp /app/opt/nodejs/bin/node /app/opt/nwjs
- cd /app/opt/nwjs && ln -s node node.exe
- rm -rf /app/opt/nodejs
- name: startup
buildsystem: simple
build-commands:
- sed -i 's/Icon=dir\/res\/icons\/wechat-devtools.svg/Icon=io.github.msojocs.wechat_devtools/' template.desktop
- sed -i 's/Exec=dir\/bin\/wechat-devtools/Exec=startup/' template.desktop
post-install:
- install -Dm755 wechat-devtools /app/opt/bin/wechat-devtools
- install -Dm755 startup.sh /app/bin/startup
- install -Dm644 template.desktop /app/share/applications/io.github.msojocs.wechat-devtools.desktop
- install -Dm644 wechat-devtools.svg /app/share/icons/hicolor/scalable/apps/io.github.msojocs.wechat-devtools.svg
sources:
- type: file
path: bin/wechat-devtools
- type: file
path: res/flatpak/startup.sh
- type: file
path: res/template.desktop
- type: file
path: res/icons/wechat-devtools.svg

View File

@ -70,8 +70,6 @@
目前支持以下平台:
1. [AUR](https://aur.archlinux.org/packages/wechat-devtools)
2. [Snap Store](https://snapcraft.io/wechat-devtools)
3. 统信商店(家庭版)、深度商店(社区版)
# 自行构建

View File

@ -1,11 +0,0 @@
[Desktop Entry]
Name=WeChat Dev Tools
Name[zh_CN]=
Comment=The development tools for wechat projects
Comment[zh_CN]=IDE
Categories=Development;WebDevelopment;IDE;
Exec=wechat-devtools %U
Icon=${SNAP}/meta/gui/wechat-devtools.png
Type=Application
Terminal=false
MimeType=x-scheme-handler/wechatide

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 KiB

View File

@ -1,202 +0,0 @@
name: wechat-devtools # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '1.06.2209070-1' # just for humans, typically '1.2+git' or '1.3.2'
summary: WeChat Devtools for Linux # 79 char long summary
description: |
WeChat Devtools for Linux.
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
architectures:
- build-on: [amd64]
run-on: [amd64]
# pull
# build
# stage
# prime
# snap
# /root/parts/my-part/src/nw
parts:
node-js:
plugin: dump
source: https://npmmirror.com/mirrors/node/v16.4.2/node-v16.4.2-linux-x64.tar.gz
# source: cache/node-v16.4.2-linux-x64.tar.gz
organize:
"*": node/
override-build: |
mkdir -p $SNAPCRAFT_STAGE/node
cp -r * $SNAPCRAFT_STAGE/node
ls -l
ls -l $SNAPCRAFT_PART_INSTALL
package-nw:
plugin: dump
source: https://servicewechat.com/wxa-dev-logic/download_redirect?type=x64&from=mpwiki&download_version=1062209070&version_type=1
# source: cache/wechat_devtools_1.05.2204180_x64.exe
source-type: 7z
source-subdir: code
override-build: |
chmod -R 755 code/package.nw
cp -r code/package.nw $SNAPCRAFT_STAGE
# after 会执行到stage
build-node:
plugin: nil
build-environment:
- PATH: "$SNAPCRAFT_STAGE/node/bin:$PATH"
- NW_VERSION: 0.55.0
- WINE: 'false'
# - NW_PACKAGE_DIR: "$SNAPCRAFT_PART_BUILD/code/package.nw"
# - srcdir: "$SNAPCRAFT_PROJECT_DIR"
build-packages:
- python2.7
- libxkbfile-dev
- pkg-config
- libkrb5-dev
- gcc
- g++
- make
- openssl
- libssh2-1-dev
- wget
override-pull: |
ls -l
override-build: |
env
echo "=============3============"
ls -l $SNAPCRAFT_PART_SRC
ls -l $SNAPCRAFT_PART_BUILD
ls -l $SNAPCRAFT_PART_INSTALL
ls -l $SNAPCRAFT_PRIME
ls -l $SNAPCRAFT_PROJECT_DIR
ls -l $SNAPCRAFT_STAGE
ls -l
cd $SNAPCRAFT_PROJECT_DIR/compiler && npm install
cd $SNAPCRAFT_PART_BUILD
# 准备文件
cp -r $SNAPCRAFT_STAGE/package.nw package.nw
chmod -R 755 package.nw
cp -r "${SNAPCRAFT_PROJECT_DIR}/tools" tools
cp -r "${SNAPCRAFT_PROJECT_DIR}/compiler" compiler
# 执行构建脚本
npm install node-gyp nw-gyp -g --registry=https://registry.npm.taobao.org
node-gyp install --registry=https://registry.npm.taobao.org
for script in fix-package-name.js fix-cli.sh fix-core.sh fix-other.sh; do
echo -e "\e[1;34mrun ${script}\e[0m"
tools/${script}
done
# 构建模块
tools/rebuild-node-modules.sh $NW_VERSION
rm -rf tools
cp -r package.nw $SNAPCRAFT_PART_INSTALL
chmod -R 755 $SNAPCRAFT_PART_INSTALL/package.nw
stage-packages:
- libxkbfile1
- git-core
- libssh2-1-dev
after:
- node-js
- package-nw
# - desktop-gnome-platform
nw-js:
plugin: dump
source: https://npmmirror.com/mirrors/nwjs/v0.55.0/nwjs-sdk-v0.55.0-linux-x64.tar.gz
# source: ./cache/nwjs-sdk-v0.55.0-linux-x64.tar.gz
organize:
"*": nwjs/
stage-packages:
- libnss3
- libnspr4
override-pull: |
ls -l
ls -l $SNAPCRAFT_PART_SRC
ls -l $SNAPCRAFT_PART_BUILD
snapcraftctl pull
ls -l
ls -l $SNAPCRAFT_PART_SRC
ls -l $SNAPCRAFT_PART_BUILD
rm -rf nacl_irt_x86_64.nexe
# chmod 644 nacl_irt_x86_64.nexe
# tar -zcf nacl_irt_x86_64.nexe.tar.gz nacl_irt_x86_64.nexe
# ln -s $SNAP/nacl_irt_x86_64.nexe nacl_irt_x86_64.nexe
ls -l
ls -l $SNAPCRAFT_PART_SRC
ls -l $SNAPCRAFT_PART_BUILD
ls -l $SNAPCRAFT_PART_INSTALL
ls -l $SNAPCRAFT_STAGE
override-build: |
ls -l
rm -rf $SNAPCRAFT_PART_INSTALL/nwjs/node $SNAPCRAFT_PART_INSTALL/nwjs/node.exe
install -Dm755 $SNAPCRAFT_STAGE/node/bin/node $SNAPCRAFT_PART_INSTALL/nwjs/node
cd $SNAPCRAFT_PART_INSTALL/nwjs && ln -s node node.exe
ls -l $SNAPCRAFT_PART_INSTALL/nwjs
snapcraftctl build
ls -l $SNAPCRAFT_PART_INSTALL/nwjs
after:
- build-node
run-script:
plugin: nil
override-build: |
snapcraftctl build
ls
install -Dm755 "${SNAPCRAFT_PROJECT_DIR}/bin/wechat-devtools" "$SNAPCRAFT_PART_INSTALL/bin/wechat-devtools"
install -Dm755 "${SNAPCRAFT_PROJECT_DIR}/bin/wechat-devtools-cli" "$SNAPCRAFT_PART_INSTALL/bin/wechat-devtools-cli"
stage:
- bin/wechat-devtools
- bin/wechat-devtools-cli
- usr/*
apps:
wechat-devtools:
# autostart: wechat-devtools.desktop
command: bin/wechat-devtools
environment:
WECHAT_DEVTOOLS_DIR: $SNAP/nwjs
APPDATA: "$SNAP_USER_DATA/wechat_devtools"
PATH: "$SNAP/node/bin:$SNAP/nwjs:$PATH"
USERPROFILE: $SNAP_USER_DATA
GIT_EXEC_PATH: $SNAP/usr/lib/git-core
extensions:
- gnome-3-34
plugs:
- desktop
- desktop-legacy
- opengl
- mount-observe
- adb-support
- x11
- wayland
- network
- network-bind
- gsettings
- browser-support
- home
- system-observe
- removable-media
- udisks2
- unity7
plugs:
gtk-3-themes:
interface: content
target: $SNAP/data-dir/themes
default-provider: gtk-common-themes
icon-themes:
interface: content
target: $SNAP/data-dir/icons
default-provider: gtk-common-themes
sound-themes:
interface: content
target: $SNAP/data-dir/sounds
default-provider: gtk-common-themes