🎨 Output is more standardized
This commit is contained in:
24
.github/workflows/pake-cli.yaml
vendored
24
.github/workflows/pake-cli.yaml
vendored
@@ -56,49 +56,49 @@ jobs:
|
||||
fail-fast: false
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: install node
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: install Rust for ubuntu-20.04
|
||||
- name: Install Rust for ubuntu-20.04
|
||||
if: inputs.platform == 'ubuntu-20.04'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-musl
|
||||
|
||||
- name: install Rust for windows-latest
|
||||
- name: Install Rust for windows-latest
|
||||
if: inputs.platform == 'windows-latest'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable-x86_64-msvc
|
||||
target: x86_64-pc-windows-msvc
|
||||
|
||||
- name: install Rust for macos-latest
|
||||
- name: Install Rust for macos-latest
|
||||
if: inputs.platform == 'macos-latest'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-apple-darwin
|
||||
|
||||
- name: install dependencies (ubuntu only)
|
||||
- name: Install dependencies (ubuntu only)
|
||||
if: inputs.platform == 'ubuntu-20.04'
|
||||
uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
with:
|
||||
packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra
|
||||
version: 1.1
|
||||
|
||||
- name: install pake-cli local
|
||||
- name: Install pake-cli local
|
||||
shell: bash
|
||||
run: |
|
||||
echo "install pake on local"
|
||||
npm install pake-cli
|
||||
|
||||
- name: rust cache restore
|
||||
- name: Rust cache restore
|
||||
uses: actions/cache/restore@v3
|
||||
id: cache_store
|
||||
with:
|
||||
@@ -110,12 +110,12 @@ jobs:
|
||||
node_modules/pake-cli/src-tauri/target/
|
||||
key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
|
||||
|
||||
- name: install dependencies
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install shelljs
|
||||
npm install axios
|
||||
|
||||
- name: build with pake-cli
|
||||
- name: Build with pake-cli
|
||||
run: |
|
||||
node ./script/build_with_pake_cli.mjs
|
||||
env:
|
||||
@@ -130,14 +130,14 @@ jobs:
|
||||
MULTI_ARCH: ${{ inputs.multi_arch }}
|
||||
TARGETS: ${{ inputs.targets }}
|
||||
|
||||
- name: upload archive
|
||||
- name: Upload archive
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: output-${{ inputs.platform }}.zip
|
||||
path: node_modules/pake-cli/output/*
|
||||
retention-days: 3
|
||||
|
||||
- name: rust cache store
|
||||
- name: Rust cache store
|
||||
uses: actions/cache/save@v3
|
||||
if: steps.cache_store.outputs.cache-hit != 'true'
|
||||
with:
|
||||
|
||||
162
apps.conf.json
162
apps.conf.json
@@ -1,82 +1,82 @@
|
||||
{
|
||||
"apps": [
|
||||
{
|
||||
"name": "programmusic",
|
||||
"title": "ProgramMusic",
|
||||
"name_zh": "ProgramMusic",
|
||||
"url": "https://musicforprogramming.net/"
|
||||
},
|
||||
{
|
||||
"name": "twitter",
|
||||
"title": "Twitter",
|
||||
"name_zh": "推特",
|
||||
"url": "https://twitter.com/"
|
||||
},
|
||||
{
|
||||
"name": "youtube",
|
||||
"title": "YouTube",
|
||||
"name_zh": "YouTube",
|
||||
"url": "https://www.youtube.com"
|
||||
},
|
||||
{
|
||||
"name": "reference",
|
||||
"title": "Reference",
|
||||
"name_zh": "Reference",
|
||||
"url": "https://quickref.me/zh-CN/"
|
||||
},
|
||||
{
|
||||
"name": "coderunner",
|
||||
"title": "CodeRunner",
|
||||
"name_zh": "CodeRunner",
|
||||
"url": "https://riju.codes/"
|
||||
},
|
||||
{
|
||||
"name": "chatgpt",
|
||||
"title": "ChatGPT",
|
||||
"name_zh": "ChatGPT",
|
||||
"url": "https://chat.openai.com/chat"
|
||||
},
|
||||
{
|
||||
"name": "flomo",
|
||||
"title": "Flomo",
|
||||
"name_zh": "浮墨",
|
||||
"url": "https://v.flomoapp.com/mine"
|
||||
},
|
||||
{
|
||||
"name": "qwerty",
|
||||
"title": "Qwerty",
|
||||
"name_zh": "Qwerty",
|
||||
"url": "https://qwerty.kaiyi.cool/"
|
||||
},
|
||||
{
|
||||
"name": "lizhi",
|
||||
"title": "LiZhi",
|
||||
"name_zh": "李志",
|
||||
"url": "https://lizhi.turkyden.com/?from=pake"
|
||||
},
|
||||
{
|
||||
"name": "xiaohongshu",
|
||||
"title": "XiaoHongShu",
|
||||
"name_zh": "小红书",
|
||||
"url": "https://www.xiaohongshu.com/explore"
|
||||
},
|
||||
{
|
||||
"name": "poe",
|
||||
"title": "Poe",
|
||||
"name_zh": "Poe",
|
||||
"url": "https://poe.com/"
|
||||
},
|
||||
{
|
||||
"name": "youtubemusic",
|
||||
"title": "YouTubeMusic",
|
||||
"name_zh": "YouTubeMusic",
|
||||
"url": "https://music.youtube.com/"
|
||||
},
|
||||
{
|
||||
"name": "weread",
|
||||
"title": "WeRead",
|
||||
"name_zh": "微信阅读",
|
||||
"url": "https://weread.qq.com/"
|
||||
}
|
||||
]
|
||||
}
|
||||
"apps": [
|
||||
{
|
||||
"name": "programmusic",
|
||||
"title": "ProgramMusic",
|
||||
"name_zh": "ProgramMusic",
|
||||
"url": "https://musicforprogramming.net/"
|
||||
},
|
||||
{
|
||||
"name": "twitter",
|
||||
"title": "Twitter",
|
||||
"name_zh": "推特",
|
||||
"url": "https://twitter.com/"
|
||||
},
|
||||
{
|
||||
"name": "youtube",
|
||||
"title": "YouTube",
|
||||
"name_zh": "YouTube",
|
||||
"url": "https://www.youtube.com"
|
||||
},
|
||||
{
|
||||
"name": "reference",
|
||||
"title": "Reference",
|
||||
"name_zh": "Reference",
|
||||
"url": "https://quickref.me/zh-CN/"
|
||||
},
|
||||
{
|
||||
"name": "coderunner",
|
||||
"title": "CodeRunner",
|
||||
"name_zh": "CodeRunner",
|
||||
"url": "https://riju.codes/"
|
||||
},
|
||||
{
|
||||
"name": "chatgpt",
|
||||
"title": "ChatGPT",
|
||||
"name_zh": "ChatGPT",
|
||||
"url": "https://chat.openai.com/chat"
|
||||
},
|
||||
{
|
||||
"name": "flomo",
|
||||
"title": "Flomo",
|
||||
"name_zh": "浮墨",
|
||||
"url": "https://v.flomoapp.com/mine"
|
||||
},
|
||||
{
|
||||
"name": "qwerty",
|
||||
"title": "Qwerty",
|
||||
"name_zh": "Qwerty",
|
||||
"url": "https://qwerty.kaiyi.cool/"
|
||||
},
|
||||
{
|
||||
"name": "lizhi",
|
||||
"title": "LiZhi",
|
||||
"name_zh": "李志",
|
||||
"url": "https://lizhi.turkyden.com/?from=pake"
|
||||
},
|
||||
{
|
||||
"name": "xiaohongshu",
|
||||
"title": "XiaoHongShu",
|
||||
"name_zh": "小红书",
|
||||
"url": "https://www.xiaohongshu.com/explore"
|
||||
},
|
||||
{
|
||||
"name": "poe",
|
||||
"title": "Poe",
|
||||
"name_zh": "Poe",
|
||||
"url": "https://poe.com/"
|
||||
},
|
||||
{
|
||||
"name": "youtubemusic",
|
||||
"title": "YouTubeMusic",
|
||||
"name_zh": "YouTubeMusic",
|
||||
"url": "https://music.youtube.com/"
|
||||
},
|
||||
{
|
||||
"name": "weread",
|
||||
"title": "WeRead",
|
||||
"name_zh": "微信阅读",
|
||||
"url": "https://weread.qq.com/"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
42
script/build_with_pake_cli.mjs
vendored
42
script/build_with_pake_cli.mjs
vendored
@@ -9,24 +9,22 @@ const { exec, cd, mv } = shelljs;
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
console.log("Welcome to use Pake Cli");
|
||||
console.log("\n=======================");
|
||||
console.log("build for app");
|
||||
console.log("Node.js info in your localhost ", process.version);
|
||||
console.log("\n=======================\n");
|
||||
|
||||
console.log("\n=======================");
|
||||
console.log("pake parameters is: ");
|
||||
console.log("url: ", process.env.URL);
|
||||
console.log("name: ", process.env.NAME);
|
||||
console.log("icon: ", process.env.ICON);
|
||||
console.log("height: ", process.env.HEIGHT);
|
||||
console.log("width: ", process.env.WIDTH);
|
||||
console.log("transparent: ", process.env.TRANSPARENT);
|
||||
console.log("resize: ", process.env.RESIZE);
|
||||
console.log("is multi arch? only for Mac: ", process.env.MULTI_ARCH);
|
||||
console.log("targets type? only for Linux: ", process.env.TARGETS);
|
||||
console.log("===========================\n");
|
||||
console.log('Welcome to use Pake Cli');
|
||||
console.log('\n=======================');
|
||||
console.log('build for app');
|
||||
console.log('Node.js info in your localhost ', process.version);
|
||||
console.log('\n=======================\n');
|
||||
console.log('Pake parameters is: ');
|
||||
console.log('url: ', process.env.URL);
|
||||
console.log('name: ', process.env.NAME);
|
||||
console.log('icon: ', process.env.ICON);
|
||||
console.log('height: ', process.env.HEIGHT);
|
||||
console.log('width: ', process.env.WIDTH);
|
||||
console.log('transparent: ', process.env.TRANSPARENT);
|
||||
console.log('resize: ', process.env.RESIZE);
|
||||
console.log('is multi arch? only for Mac: ', process.env.MULTI_ARCH);
|
||||
console.log('targets type? only for Linux: ', process.env.TARGETS);
|
||||
console.log('===========================\n');
|
||||
|
||||
cd('node_modules/pake-cli');
|
||||
let params = `node cli.js ${process.env.URL} --name ${process.env.NAME}`;
|
||||
@@ -36,7 +34,7 @@ if (process.env.ICON) {
|
||||
axios({
|
||||
method: 'get',
|
||||
url: process.env.ICON,
|
||||
responseType: 'stream'
|
||||
responseType: 'stream',
|
||||
}).then(function (response) {
|
||||
response.data.pipe(fs.createWriteStream(iconPath));
|
||||
params = `${params} --icon ${iconPath}`;
|
||||
@@ -74,13 +72,13 @@ if (process.platform === 'darwin') {
|
||||
params = `${params} --show-menu`;
|
||||
}
|
||||
|
||||
console.log("Pake parameters is: ", params);
|
||||
console.log("compile....");
|
||||
console.log('Pake parameters is: ', params);
|
||||
console.log('Compile....');
|
||||
exec(params);
|
||||
|
||||
if (!fs.existsSync('output')) {
|
||||
fs.mkdirSync('output');
|
||||
}
|
||||
mv(`${process.env.NAME}.*`, 'output/');
|
||||
console.log("Build Success");
|
||||
console.log('Build Success');
|
||||
cd('../..');
|
||||
|
||||
Reference in New Issue
Block a user