Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d0a7907

Browse files
committed
Squashed commit of the following:
commit 48f6b5450d7d0983f1f697c176cf1e129bb51629 Author: msojocs <jiyecafe@gmail.com> Date: Fri Mar 4 18:12:47 2022 +0800 refactor: build
1 parent 3f7f7a6 commit d0a7907

File tree

15 files changed

+251
-239
lines changed

15 files changed

+251
-239
lines changed

‎.github/workflows/release.yml‎

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
push:
1010
tags:
1111
- v*
12-
branches: [ master, aur]
12+
branches: [ master, build]
1313
pull_request:
1414
branches: [ master ]
1515
# # Allows you to run this workflow manually from the Actions tab
@@ -22,26 +22,17 @@ jobs:
2222

2323
strategy:
2424
matrix:
25-
node-version: [16.x]
2625
ARCH: ['x86_64']
2726
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2827

2928
steps:
3029
- uses: actions/checkout@v2
3130
- name: Use Node.js ${{ matrix.node-version }}
3231
uses: actions/setup-node@v2
33-
with:
34-
node-version: ${{ matrix.node-version }}
35-
cache: 'npm'
3632

37-
- name: Prepare
33+
- name: Test
3834
run: |
39-
pwd
40-
ls -l
41-
export ACTION_MODE=true
42-
sudo apt-get install -y libx11-dev libxkbfile-dev p7zip-full python2 python3 libkrb5-dev gcc openssl libssh2-1-dev g++ make
43-
npm install node-gyp nw-gyp npm -g
44-
node-gyp install
35+
echo "$UID, $GID"
4536
4637
- name: Generate TAG
4738
id: Tag
@@ -58,24 +49,25 @@ jobs:
5849
5950
- name: Build
6051
run: |
61-
# docker-compose up
62-
export ACTION=true
52+
export ACTION_MODE=true
53+
export DOCKER_UID=$UID
54+
export DOCKER_GID=$GID
6355
# tar.gz AppImage
6456
ls -l
65-
tools/setup-wechat-devtools-bash
66-
sudo chmod -R 755 package.nw
67-
bash tools/build-release.sh ${{ steps.tag.outputs.tag }} ${{ matrix.ARCH }}
57+
docker-compose up
58+
mkdir -p tmp/build
59+
tools/build-release.sh ${{ steps.tag.outputs.tag }} ${{ matrix.ARCH }}
6860
6961
- name: Compress nodegit compiler
7062
run: |
7163
ls -l
72-
sudo cp -r package.nw/node_modules/nodegit tmp/build/nodegit
73-
sudo cp -r compiler tmp/build/compiler
64+
cp -r package.nw/node_modules/nodegit tmp/build/nodegit
65+
cp -r compiler tmp/build/compiler
7466
cd tmp/build
7567
ls -l
7668
tar -zcf compiler.tar.gz compiler
7769
tar -zcf nodegit.tar.gz nodegit
78-
sudo rm -rf compiler nodegit
70+
rm -rf compiler nodegit
7971
ls -l
8072
8173
- name: View Directory
@@ -119,14 +111,12 @@ jobs:
119111
- name: Build Deb Package
120112
run: |
121113
export BUILD_VERSION=${{ steps.tag.outputs.tag }}
122-
tools/build-deb.sh
123-
# deb
124-
sudo chmod -R 777 tmp
125-
cd tmp
126-
ls -l deb
127-
mkdir -p build
128-
mv deb/*.deb build
129-
ls -l build
114+
export DOCKER_UID=$UID
115+
export DOCKER_GID=$GID
116+
docker-compose up
117+
ls -l
118+
mkdir -p tmp/build
119+
tools/build-deb.sh ${{ steps.tag.outputs.tag }}
130120
131121
- name: Upload artifact
132122
uses: actions/upload-artifact@v2.3.1

‎docker-compose.yml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
version: "3"
22
services:
33
wechat_devtools:
4-
#image: node:16.13.1
5-
build:
6-
context: ./docker
7-
dockerfile: Dockerfile
4+
image: jiyecafe/wechat-devtools-build:latest
5+
#build:
6+
# context: ./docker
7+
# dockerfile: Dockerfile
88
volumes:
99
- .:/workspace
1010
- ./cache/.npm:/root/.npm
1111
environment:
12-
- ACTION=${ACTION_MODE:-false}
12+
- ACTION_MODE=${ACTION_MODE:-false}
1313
# - https_proxy=${https_proxy:-}
1414
- NO_WINE=${NO_WINE:-true}
15-
- LOCAL_USER_ID=${UID:-1000}
15+
- LOCAL_USER_ID=${DOCKER_UID:-1000}
16+
- LOCAL_GROUP_ID=${DOCKER_GID:-1000}
17+
- BUILD_VERSION=${BUILD_VERSION:-v0}
1618
entrypoint: /workspace/docker/docker-entrypoint
1719
userns_mode: "host"

‎docker/Dockerfile‎

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
1-
FROM node:16.13.1
1+
FROM debian:9.13-slim
22

3-
RUN echo "\
4-
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free\
5-
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
6-
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free\
7-
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
8-
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free\
9-
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
10-
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free\
11-
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
12-
"> /etc/apt/sources.list && apt-get clean && \
13-
apt-get update && set -eux; \
14-
apt-get update; \
15-
apt-get install -y gosu libx11-dev libxkbfile-dev p7zip-full; \
16-
rm -rf /var/lib/apt/lists/*; \
17-
# verify that the binary works
18-
gosu nobody true;
3+
WORKDIR /workspace
194

20-
WORKDIR /workspace
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 && \
31+
gosu nobody true && \
32+
useradd -s /bin/bash -m user

‎docker/docker-entrypoint‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
#!/bin/bash
22

3-
if [ "$(id -u)" -eq '0' ]
4-
then
5-
USER_ID=${LOCAL_USER_ID:-9001}
6-
usermod -u ${USER_ID} -g ${USER_ID} node > /dev/null 2>&1
7-
chown -R ${USER_ID}:${USER_ID} /workspace > /dev/null 2>&1
3+
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
4+
strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_2.2
5+
6+
notice() {
7+
echo -e "033円[36m 1ドル 033円[0m "
8+
}
9+
10+
if [ "$(id -u)" -eq '0' ];then
11+
USER_ID=${LOCAL_USER_ID:-1000}
12+
GROUP_ID=${LOCAL_GROUP_ID:-1000}
13+
notice "$USER_ID, $GROUP_ID"
14+
usermod -u ${USER_ID} -g ${GROUP_ID} user > /dev/null 2>&1
15+
chown -R ${USER_ID}:${GROUP_ID} /workspace > /dev/null 2>&1
816

9-
ACTION_MODE=$( export ACTION_MODE )
1017
if [ $ACTION_MODE!='true' ]; then
18+
notice "非ACTION模式, 设置镜像源"
1119
npm set registry https://r.npm.taobao.org # 注册模块镜像
1220
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
1321
## 以下选择添加
@@ -20,12 +28,11 @@ then
2028
npm set selenium_cdnurl https://npm.taobao.org/mirrors/selenium # selenium 二进制包镜像
2129
npm set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector # node-inspector 二进制包镜像
2230
# npm cache clean --force # 清空缓存
23-
2431
fi
2532

2633
# ls -l
2734
# cat /etc/passwd
28-
exec gosu node docker/entrypoint
35+
exec gosu user docker/entrypoint
2936

3037
fi
3138

‎docker/entrypoint‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ cd /workspace
2727
rm -rf node nwjs package.nw
2828
#
2929
# exec ./tools/rebuild-node-modules 0.53.1
30-
exec ./tools/setup-wechat-devtools-bash
30+
./tools/setup-wechat-devtools-bash
31+
32+
chmod -R 777 tmp node nwjs package.nw
33+
ls -l package.nw

‎res/deb/docker-compose.yml‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎res/deb/docker/Dockerfile‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎res/deb/docker/docker-entrypoint‎

Lines changed: 0 additions & 59 deletions
This file was deleted.

‎tools/appimage.sh‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /