update: deb build

This commit is contained in:
msojocs 2022-03-03 23:20:45 +08:00
parent 7f2112e7af
commit 5bcdb80d8b
15 changed files with 205 additions and 45 deletions

View File

@ -91,11 +91,10 @@ jobs:
build-deb: build-deb:
name: Build Deb Package name: Build Deb Package
runs-on: ubuntu-latest runs-on: ubuntu-18.04
strategy: strategy:
matrix: matrix:
node-version: [16.x]
ARCH: ['x86_64'] ARCH: ['x86_64']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
@ -103,26 +102,6 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Prepare
run: |
pwd
ls -l
export ACTION_MODE=true
sudo apt-get install -y libx11-dev libxkbfile-dev p7zip-full python2 python3 libkrb5-dev gcc openssl libssh2-1-dev g++ make
npm install node-gyp nw-gyp npm -g
node-gyp install
# https://docs.makedeb.org/home/installing/apt-repository/
wget -qO - 'https://proget.hunterwittenborn.com/debian-feeds/makedeb.pub' | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg &> /dev/null
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.hunterwittenborn.com/ makedeb main' | \
sudo tee /etc/apt/sources.list.d/makedeb.list
sudo apt update
sudo apt-get install -y makedeb gconf2
- name: Generate TAG - name: Generate TAG
id: Tag id: Tag
@ -139,16 +118,14 @@ jobs:
- name: Build Deb Package - name: Build Deb Package
run: | run: |
tools/build-aur.sh deb export BUILD_VERSION=${{ steps.tag.outputs.tag }}
tools/build-deb.sh
# deb # deb
cd tmp/AUR sudo chmod -R 777 tmp
makedeb cd tmp
cd ../ ls -l deb
# ./tmp
ls -l AUR
mkdir -p build mkdir -p build
mv AUR/*.deb build mv deb/*.deb build
rm -rf AUR/pkg AUR/src
ls -l build ls -l build
- name: Upload artifact - name: Upload artifact

View File

@ -2,6 +2,8 @@ NodeJS v16.x下安装nodegit
1. `apt-get install -y python2 python3 libkrb5-dev gcc openssl libssh2-1-dev g++ make` 1. `apt-get install -y python2 python3 libkrb5-dev gcc openssl libssh2-1-dev g++ make`
2. `npm install nodegit` 2. `npm install nodegit`
python >= 3.6
## docker-compose.yaml ## docker-compose.yaml
```yaml ```yaml
version: "3" version: "3"

View File

@ -9,4 +9,5 @@ Icon=wechat-devtools
Type=Application Type=Application
Terminal=false Terminal=false
StartupWMClass=wechat_devtools StartupWMClass=wechat_devtools
Actions= Actions=
MimeType=x-scheme-handler/wechatide

View File

@ -64,7 +64,7 @@ prepare() {
ls | grep node-*linux* | xargs -I{} mv {} node ls | grep node-*linux* | xargs -I{} mv {} node
ls | grep nwjs-*linux* | xargs -I{} mv {} nwjs ls | grep nwjs-*linux* | xargs -I{} mv {} nwjs
mkdir tools mkdir -p tools
for file in *.js *.sh; do for file in *.js *.sh; do
mv $file tools; mv $file tools;
done done

13
res/deb.desktop Normal file
View File

@ -0,0 +1,13 @@
[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=/opt/wechat-devtools/bin/wechat-devtools
Icon=wechat-devtools
Type=Application
Terminal=false
StartupWMClass=wechat_devtools
Actions=
MimeType=x-scheme-handler/wechatide

View File

@ -0,0 +1,5 @@
Package: wechat-devtools
Version: BUILD_VERSION
Maintainer: msojocs
Architecture: amd64
Description: WeChat Devtools For Linux.

View File

@ -0,0 +1,13 @@
version: "3"
services:
wechat_devtools:
image: jiyecafe/wechat-devtools-build:v1
# build:
# context: ./docker
# dockerfile: Dockerfile
environment:
- NO_WINE=${NO_WINE:-true}
- BUILD_VERSION=${BUILD_VERSION:-v0}
volumes:
- ./../../:/workspace
entrypoint: /workspace/res/deb/docker/docker-entrypoint

30
res/deb/docker/Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM debian:9.13-slim
WORKDIR /workspace
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
mkdir -p /build_temp/python36 /build_temp/nodejs && \
apt update && \
apt install -y binutils software-properties-common gcc g++ \
gconf2 libxkbfile-dev p7zip-full make libssh2-1-dev libkrb5-dev wget \
openssl pkg-config build-essential && \
cd /build_temp/python36 && \
apt-get install -y aptitude &&\
aptitude -y install gcc make zlib1g-dev libffi-dev libssl-dev &&\
mkdir -p test && cd test &&\
wget http://npm.taobao.org/mirrors/python/3.6.5/Python-3.6.5.tgz &&\
tar -xvf Python-3.6.5.tgz &&\
chmod -R +x Python-3.6.5 &&\
cd Python-3.6.5/ &&\
./configure &&\
aptitude -y install libffi-dev libssl-dev &&\
make && make install &&\
cd /build_temp/nodejs &&\
wget https://deb.nodesource.com/setup_16.x &&\
chmod +x setup_16.x &&\
./setup_16.x &&\
apt-get install -y nodejs &&\
rm -rf /build_temp && \
apt install -y gosu

View File

@ -0,0 +1,59 @@
#!/bin/bash
# set -e
notice() {
echo -e "\033[36m $1 \033[0m "
}
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_2.2
# gcc -v
# g++ -v
# cc -v
# node --version
# python --version
# python3 --version
echo "=============="
cd /workspace
# mkdir -p tmp/test/node_modules
# cd tmp/test
# npm install nodegit
# tail -f /etc/issue
./tools/setup-wechat-devtools-bash
############ 构建deb包 ################
root_dir=$(cd `dirname $0`/../../.. && pwd -P)
echo "root_dir: $root_dir"
tmp_dir="$root_dir/tmp"
app_dir="$root_dir/tmp/deb"
# Remove any previous build
rm -rf $app_dir
# Make usr and icons dirs
notice "Make Dirs"
mkdir -p $app_dir/opt/wechat-devtools/bin
mkdir -p $app_dir/usr/{src,bin}
mkdir -p $app_dir/usr/share/{metainfo,icons,applications}
notice "COPY Files"
cp -r "$root_dir/res/deb/data"/* $app_dir
cp "$root_dir/bin/wechat-devtools" "$app_dir/opt/wechat-devtools/bin"
cp "$root_dir/res/deb.desktop" "$app_dir/usr/share/applications/wechat-devtools.desktop"
if [[ ! $BUILD_VERSION -eq 'continuous' ]];then
sed -i "s/BUILD_VERSION/${BUILD_VERSION//v/}/" "$app_dir/DEBIAN/control"
else
sed -i "s/BUILD_VERSION/0/" "$app_dir/DEBIAN/control"
fi
cp "$root_dir/res/icons/wechat-devtools.png" "$app_dir/usr/share/icons/wechat-devtools.png"
cp -r "$root_dir/package.nw" "$app_dir/opt/wechat-devtools/package.nw"
cp -r "$root_dir/nwjs" "$app_dir/opt/wechat-devtools/nwjs"
rm -rf "$app_dir/opt/wechat-devtools/nwjs"/{node,node.exe}
cp "$root_dir/node/bin/node" "$app_dir/opt/wechat-devtools/nwjs/node"
cd "$app_dir/opt/wechat-devtools/nwjs/" && ln -s "node" "node.exe"
notice "BUILD DEB Package"
cd "$root_dir/tmp/deb"
ls -l "$root_dir/tmp/deb"
dpkg-deb -b . "WeChat_Dev_Tools_$BUILD_VERSION.deb"

View File

@ -0,0 +1,7 @@
version: "3"
services:
wechat_devtools:
image: proget.hunterwittenborn.com/docker/makedeb/makedeb:ubuntu-bionic
volumes:
- .:/workspace
entrypoint: /workspace/docker/entrypoint

34
res/mpr/docker/entrypoint Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
root_dir=$(cd `dirname $0`/.. && pwd -P)
# exit 1
sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_2.2
sudo apt-get update
sudo apt install -y python gconf2 libxkbfile-dev p7zip-full make libssh2-1-dev libkrb5-dev
sudo apt-get install -y openssl pkg-config build-essential gcc-8 g++-8 git
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
# install bsdtar 3.3.0
wget https://launchpad.net/ubuntu/+source/libarchive/3.3.3-1/+build/15782551/+files/libarchive13_3.3.3-1_amd64.deb
sudo dpkg -i libarchive13_3.3.3-1_amd64.deb
wget https://launchpad.net/ubuntu/+source/libarchive/3.3.3-1/+build/15782551/+files/libarchive-tools_3.3.3-1_amd64.deb
sudo dpkg -i libarchive-tools_3.3.3-1_amd64.deb
wget http://launchpadlibrarian.net/401610929/bsdtar_3.3.3-1_all.deb
sudo dpkg -i bsdtar_3.3.3-1_all.deb
bsdtar --version
bsdtar --no-fflags
# sudo chmod -R 777 /workspace
cd /workspace
rm -rf src
gcc -v
g++ -v
cc -v
makedeb --printsrcinfo | tee .SRCINFO
ls -la
makedeb -s
# tail -f /etc/issue

View File

@ -1,5 +1,13 @@
#!/bin/bash #!/bin/bash
BUILD_VERSION='v1'
if [[ ! $BUILD_VERSION -eq 'continuous' ]];then
BUILD_VERSION=v0
fi
echo $BUILD_VERSION
sed -i "s/BUILD_VERSION/${BUILD_VERSION//v/}/" "/mnt/disk2/wechat-web-devtools-linux/tmp/deb/DEBIAN/control"
exit
if [[ $NO_WINE == 'true' ]];then if [[ $NO_WINE == 'true' ]];then
echo "not wine" echo "not wine"

View File

@ -11,11 +11,5 @@ cp "$root_dir/tools"/*.js "$build_dir"
cp "$root_dir/res/aur"/* "$build_dir" cp "$root_dir/res/aur"/* "$build_dir"
sed -i 's/download.fastgit.org/github.com/' "$build_dir/PKGBUILD" sed -i 's/download.fastgit.org/github.com/' "$build_dir/PKGBUILD"
if [[ $1 == 'deb' ]];then
sed -i 's/libssh2/libssh2-1-dev/' "$build_dir/PKGBUILD"
sed -i 's/libxkbfile/libxkbfile-dev/' "$build_dir/PKGBUILD"
sed -i 's/gconf/gconf2/' "$build_dir/PKGBUILD"
sed -i 's/krb5/libkrb5-dev/' "$build_dir/PKGBUILD"
fi
cd $build_dir cd $build_dir
# makepkg # makepkg

9
tools/build-deb.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
root_dir=$(cd `dirname $0`/.. && pwd -P)
BUILD_VERSION=$1
cd $root_dir/res/deb
pwd
# docker-compose down
docker-compose up

View File

@ -35,14 +35,14 @@ if [ ! -f "$root_dir/node/bin/node" ]; then
fail "Node安装失败" fail "Node安装失败"
exit exit
fi fi
# 将node加入环境
# 将node加入环境
export PATH="$root_dir/node/bin":$PATH export PATH="$root_dir/node/bin":$PATH
echo "=====安装node-gyp nw-gyp====" echo "=====安装node-gyp nw-gyp===="
npm uninstall node-gyp -g npm uninstall node-gyp -g
npm install node-gyp nw-gyp npm -g --registry=https://registry.npm.taobao.org npm install node-gyp nw-gyp npm -g --registry=https://registry.npm.taobao.org
node-gyp install node-gyp install
node-gyp list node-gyp list
echo "==========Initializing nwjs==========" echo "==========Initializing nwjs=========="
if [ -f "$root_dir/nwjs/nw" ]; then if [ -f "$root_dir/nwjs/nw" ]; then
@ -51,6 +51,14 @@ else
node "$root_dir/tools/update-nwjs-node" node "$root_dir/tools/update-nwjs-node"
fi fi
# rm -rf "$root_dir/tmp/7z"
# mkdir -p "$root_dir/tmp/7z"
# cd "$root_dir/tmp/7z"
# wget https://www.7-zip.org/a/7z2107-linux-x64.tar.xz
# tar -xJf 7z2107-linux-x64.tar.xz
# ln -s 7zz 7z
# export PATH="$root_dir/tmp/7z:$PATH"
# 7z
echo "==========Initializing wechat-devtools package==========" echo "==========Initializing wechat-devtools package=========="
if [ -f "$root_dir/package.nw/package.json" ]; then if [ -f "$root_dir/package.nw/package.json" ]; then
success "微信开发者工具安装完毕" success "微信开发者工具安装完毕"