Skip to content

Commit 5bcdb80

Browse files
committed
update: deb build
1 parent 7f2112e commit 5bcdb80

File tree

15 files changed

+205
-45
lines changed

15 files changed

+205
-45
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -91,38 +91,17 @@ jobs:
9191

9292
build-deb:
9393
name: Build Deb Package
94-
runs-on: ubuntu-latest
94+
runs-on: ubuntu-18.04
9595

9696
strategy:
9797
matrix:
98-
node-version: [16.x]
9998
ARCH: ['x86_64']
10099
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
101100

102101
steps:
103102
- uses: actions/checkout@v2
104103
- name: Use Node.js ${{ matrix.node-version }}
105104
uses: actions/setup-node@v2
106-
with:
107-
node-version: ${{ matrix.node-version }}
108-
cache: 'npm'
109-
110-
- name: Prepare
111-
run: |
112-
pwd
113-
ls -l
114-
export ACTION_MODE=true
115-
sudo apt-get install -y libx11-dev libxkbfile-dev p7zip-full python2 python3 libkrb5-dev gcc openssl libssh2-1-dev g++ make
116-
npm install node-gyp nw-gyp npm -g
117-
node-gyp install
118-
# https://docs.makedeb.org/home/installing/apt-repository/
119-
wget -qO - 'https://proget.hunterwittenborn.com/debian-feeds/makedeb.pub' | \
120-
gpg --dearmor | \
121-
sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg &> /dev/null
122-
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.hunterwittenborn.com/ makedeb main' | \
123-
sudo tee /etc/apt/sources.list.d/makedeb.list
124-
sudo apt update
125-
sudo apt-get install -y makedeb gconf2
126105

127106
- name: Generate TAG
128107
id: Tag
@@ -139,16 +118,14 @@ jobs:
139118
140119
- name: Build Deb Package
141120
run: |
142-
tools/build-aur.sh deb
121+
export BUILD_VERSION=${{ steps.tag.outputs.tag }}
122+
tools/build-deb.sh
143123
# deb
144-
cd tmp/AUR
145-
makedeb
146-
cd ../
147-
# ./tmp
148-
ls -l AUR
124+
sudo chmod -R 777 tmp
125+
cd tmp
126+
ls -l deb
149127
mkdir -p build
150-
mv AUR/*.deb build
151-
rm -rf AUR/pkg AUR/src
128+
mv deb/*.deb build
152129
ls -l build
153130
154131
- name: Upload artifact

docs/Nodegit.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ NodeJS v16.x下安装nodegit
22
1. `apt-get install -y python2 python3 libkrb5-dev gcc openssl libssh2-1-dev g++ make`
33
2. `npm install nodegit`
44

5+
python >= 3.6
6+
57
## docker-compose.yaml
68
```yaml
79
version: "3"

res/appimage.desktop

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ Icon=wechat-devtools
99
Type=Application
1010
Terminal=false
1111
StartupWMClass=wechat_devtools
12-
Actions=
12+
Actions=
13+
MimeType=x-scheme-handler/wechatide

res/aur/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ prepare() {
6464
ls | grep node-*linux* | xargs -I{} mv {} node
6565
ls | grep nwjs-*linux* | xargs -I{} mv {} nwjs
6666

67-
mkdir tools
67+
mkdir -p tools
6868
for file in *.js *.sh; do
6969
mv $file tools;
7070
done

res/deb.desktop

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Desktop Entry]
2+
Name=WeChat Dev Tools
3+
Name[zh_CN]=微信开发者工具
4+
Comment=The development tools for wechat projects
5+
Comment[zh_CN]=提供微信开发相关项目的开发IDE支持
6+
Categories=Development;WebDevelopment;IDE;
7+
Exec=/opt/wechat-devtools/bin/wechat-devtools
8+
Icon=wechat-devtools
9+
Type=Application
10+
Terminal=false
11+
StartupWMClass=wechat_devtools
12+
Actions=
13+
MimeType=x-scheme-handler/wechatide

res/deb/data/DEBIAN/control

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Package: wechat-devtools
2+
Version: BUILD_VERSION
3+
Maintainer: msojocs
4+
Architecture: amd64
5+
Description: WeChat Devtools For Linux.

res/deb/docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: "3"
2+
services:
3+
wechat_devtools:
4+
image: jiyecafe/wechat-devtools-build:v1
5+
# build:
6+
# context: ./docker
7+
# dockerfile: Dockerfile
8+
environment:
9+
- NO_WINE=${NO_WINE:-true}
10+
- BUILD_VERSION=${BUILD_VERSION:-v0}
11+
volumes:
12+
- ./../../:/workspace
13+
entrypoint: /workspace/res/deb/docker/docker-entrypoint

res/deb/docker/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM debian:9.13-slim
2+
3+
WORKDIR /workspace
4+
5+
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
6+
sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
7+
sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
8+
mkdir -p /build_temp/python36 /build_temp/nodejs && \
9+
apt update && \
10+
apt install -y binutils software-properties-common gcc g++ \
11+
gconf2 libxkbfile-dev p7zip-full make libssh2-1-dev libkrb5-dev wget \
12+
openssl pkg-config build-essential && \
13+
cd /build_temp/python36 && \
14+
apt-get install -y aptitude &&\
15+
aptitude -y install gcc make zlib1g-dev libffi-dev libssl-dev &&\
16+
mkdir -p test && cd test &&\
17+
wget http://npm.taobao.org/mirrors/python/3.6.5/Python-3.6.5.tgz &&\
18+
tar -xvf Python-3.6.5.tgz &&\
19+
chmod -R +x Python-3.6.5 &&\
20+
cd Python-3.6.5/ &&\
21+
./configure &&\
22+
aptitude -y install libffi-dev libssl-dev &&\
23+
make && make install &&\
24+
cd /build_temp/nodejs &&\
25+
wget https://deb.nodesource.com/setup_16.x &&\
26+
chmod +x setup_16.x &&\
27+
./setup_16.x &&\
28+
apt-get install -y nodejs &&\
29+
rm -rf /build_temp && \
30+
apt install -y gosu

res/deb/docker/docker-entrypoint

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
# set -e
3+
4+
notice() {
5+
echo -e "\033[36m $1 \033[0m "
6+
}
7+
8+
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
9+
strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_2.2
10+
# gcc -v
11+
# g++ -v
12+
# cc -v
13+
# node --version
14+
# python --version
15+
# python3 --version
16+
17+
echo "=============="
18+
cd /workspace
19+
# mkdir -p tmp/test/node_modules
20+
# cd tmp/test
21+
# npm install nodegit
22+
# tail -f /etc/issue
23+
./tools/setup-wechat-devtools-bash
24+
25+
############ 构建deb包 ################
26+
root_dir=$(cd `dirname $0`/../../.. && pwd -P)
27+
echo "root_dir: $root_dir"
28+
tmp_dir="$root_dir/tmp"
29+
app_dir="$root_dir/tmp/deb"
30+
31+
# Remove any previous build
32+
rm -rf $app_dir
33+
# Make usr and icons dirs
34+
notice "Make Dirs"
35+
mkdir -p $app_dir/opt/wechat-devtools/bin
36+
mkdir -p $app_dir/usr/{src,bin}
37+
mkdir -p $app_dir/usr/share/{metainfo,icons,applications}
38+
39+
notice "COPY Files"
40+
cp -r "$root_dir/res/deb/data"/* $app_dir
41+
cp "$root_dir/bin/wechat-devtools" "$app_dir/opt/wechat-devtools/bin"
42+
cp "$root_dir/res/deb.desktop" "$app_dir/usr/share/applications/wechat-devtools.desktop"
43+
if [[ ! $BUILD_VERSION -eq 'continuous' ]];then
44+
sed -i "s/BUILD_VERSION/${BUILD_VERSION//v/}/" "$app_dir/DEBIAN/control"
45+
else
46+
sed -i "s/BUILD_VERSION/0/" "$app_dir/DEBIAN/control"
47+
fi
48+
cp "$root_dir/res/icons/wechat-devtools.png" "$app_dir/usr/share/icons/wechat-devtools.png"
49+
50+
cp -r "$root_dir/package.nw" "$app_dir/opt/wechat-devtools/package.nw"
51+
cp -r "$root_dir/nwjs" "$app_dir/opt/wechat-devtools/nwjs"
52+
rm -rf "$app_dir/opt/wechat-devtools/nwjs"/{node,node.exe}
53+
cp "$root_dir/node/bin/node" "$app_dir/opt/wechat-devtools/nwjs/node"
54+
cd "$app_dir/opt/wechat-devtools/nwjs/" && ln -s "node" "node.exe"
55+
56+
notice "BUILD DEB Package"
57+
cd "$root_dir/tmp/deb"
58+
ls -l "$root_dir/tmp/deb"
59+
dpkg-deb -b . "WeChat_Dev_Tools_$BUILD_VERSION.deb"

res/mpr/docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: "3"
2+
services:
3+
wechat_devtools:
4+
image: proget.hunterwittenborn.com/docker/makedeb/makedeb:ubuntu-bionic
5+
volumes:
6+
- .:/workspace
7+
entrypoint: /workspace/docker/entrypoint

0 commit comments

Comments
 (0)