mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-22 00:00:04 +08:00
update(actions)
This commit is contained in:
parent
35f4dcd1bc
commit
b64c5934f3
55
.github/workflows/release.yml
vendored
Normal file
55
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
||||||
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||||
|
|
||||||
|
name: Node.js CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
branches: [ master ]
|
||||||
|
# pull_request:
|
||||||
|
# branches: [ master ]
|
||||||
|
# # Allows you to run this workflow manually from the Actions tab
|
||||||
|
# workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [16.x]
|
||||||
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
cache: 'npm'
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
ls -l
|
||||||
|
chmod 777 docker/entrypoint
|
||||||
|
chmod 777 tools/*
|
||||||
|
export ACTION_MODE=true
|
||||||
|
tools/setup-wechat-devtools-node
|
||||||
|
|
||||||
|
- name: Delete unused file
|
||||||
|
run: |
|
||||||
|
sudo rm -rf cache tmp
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: fnkr/github-action-ghr@v1
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
env:
|
||||||
|
GHR_COMPRESS: xz
|
||||||
|
GHR_PATH: /github/workspace
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"description": "此处版本应与nwjs使用的node版本一致",
|
"description": "此处版本应与nwjs使用的node版本一致",
|
||||||
"version": "14.5.0",
|
"version": "14.5.0",
|
||||||
"url": "https://npm.taobao.org/mirrors/node/v${version}/node-v${version}-linux-x64.tar.gz"
|
"url": "https://npm.taobao.org/mirrors/node/v${version}/node-v${version}-linux-x64.tar.gz",
|
||||||
|
"url-global": "https://nodejs.org/download/release/v${version}/node-v${version}-linux-x64.tar.gz"
|
||||||
}
|
}
|
@ -1,7 +1,9 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
web:
|
wechat_devtools:
|
||||||
image: node:16.13.1
|
image: node:16.13.1
|
||||||
volumes:
|
volumes:
|
||||||
- .:/workspace
|
- .:/workspace
|
||||||
|
environment:
|
||||||
|
- ACTION=${ACTION_MODE:-false}
|
||||||
entrypoint: /workspace/docker/entrypoint
|
entrypoint: /workspace/docker/entrypoint
|
@ -36,12 +36,10 @@ echo "\
|
|||||||
|
|
||||||
apt-get clean; # 清空缓存
|
apt-get clean; # 清空缓存
|
||||||
apt-get update; # 更新
|
apt-get update; # 更新
|
||||||
apt-get install -y libx11-dev libxkbfile-dev
|
apt-get install -y libx11-dev libxkbfile-dev p7zip-full
|
||||||
|
|
||||||
hash node-gyp 2>/dev/null || {
|
|
||||||
echo >&2 "I require node-gyp but it's not installed. Installing.";
|
|
||||||
npm install -g node-gyp
|
npm install -g node-gyp
|
||||||
}
|
node-gyp install
|
||||||
node-gyp list
|
node-gyp list
|
||||||
|
|
||||||
|
|
||||||
@ -55,10 +53,5 @@ node-gyp list
|
|||||||
# end test
|
# end test
|
||||||
|
|
||||||
cd /workspace
|
cd /workspace
|
||||||
hash 7z 2>/dev/null || {
|
# export https_proxy="http://192.168.249.236:7890"
|
||||||
echo >&2 "I require 7z but it's not installed. Installing.";
|
|
||||||
apt-get update
|
|
||||||
apt-get install p7zip-full -y
|
|
||||||
}
|
|
||||||
export https_proxy="http://192.168.249.236:7890"
|
|
||||||
exec ./tools/setup-wechat-devtools-bash
|
exec ./tools/setup-wechat-devtools-bash
|
||||||
|
2
test/env
Normal file
2
test/env
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
console.log(process.env['action']==='true')
|
@ -5,16 +5,18 @@ const { spawn } = require("child_process");
|
|||||||
|
|
||||||
const parseFile = function (path) {
|
const parseFile = function (path) {
|
||||||
|
|
||||||
|
console.log("fix start")
|
||||||
if (!fs.existsSync(path)) {
|
if (!fs.existsSync(path)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log("content")
|
||||||
let content = JSON.parse(fs.readFileSync(path, "utf8"));
|
let content = JSON.parse(fs.readFileSync(path, "utf8"));
|
||||||
|
|
||||||
content.name = "wechat_devtools";
|
content.name = "wechat_devtools";
|
||||||
// 开启调试,更新参数
|
// 开启调试,更新参数
|
||||||
content['chromium-args'] = content['chromium-args'].replace('--disable-devtools', '').replace('--ignore-gpu-blacklist', '--ignore-gpu-blocklist')
|
content['chromium-args'] = content['chromium-args'].replace('--disable-devtools', '').replace('--ignore-gpu-blacklist', '--ignore-gpu-blocklist')
|
||||||
|
|
||||||
|
console.log("arite")
|
||||||
fs.writeFileSync(path, JSON.stringify(content, null, 4));
|
fs.writeFileSync(path, JSON.stringify(content, null, 4));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -13,8 +13,8 @@ const download = function () {
|
|||||||
fs.mkdirSync(path.resolve(__dirname, "../cache"));
|
fs.mkdirSync(path.resolve(__dirname, "../cache"));
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
|
|
||||||
let url = nodeConfig.url
|
let url = process.env['ACTION'] === 'true'?nodeConfig["url-global"]:nodeConfig.url
|
||||||
.replace("${version}", nodeConfig.version)
|
url = url.replace("${version}", nodeConfig.version)
|
||||||
.replace("${version}", nodeConfig.version);
|
.replace("${version}", nodeConfig.version);
|
||||||
|
|
||||||
let localPath = path.resolve(
|
let localPath = path.resolve(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user