- **When running "Build App With Pake CLI" GitHub Action, it throws `MODULE_NOT_FOUND` because path `script/` is missing an "s", fixed to `scripts/`** - description: - encountered an error while running the "Build App With Pake CLI" workflow - searching through the repository files, I located the relevant file at: [Pake/scripts/github-action-build.js atbf12d85dc5· tw93/Pake](bf12d85dc5/scripts/github-action-build.js) - Upon verification, the correct path to this file within the repository is `scripts/github-action-build.js`. - error message: ``` Run node ./script/github-action-build.js node:internal/modules/cjs/loader:1368 throw err; ^ Error: Cannot find module 'D:\a\Pake\Pake\script\github-action-build.js' 错误:找不到模块 'D:\a\Pake\Pake\script\github-action-build.js' at Function._resolveFilename (node:internal/modules/cjs/loader:1365:15) at defaultResolveImpl (node:internal/modules/cjs/loader:1021:19) at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1026:22) at Function._load (node:internal/modules/cjs/loader:1175:37) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:235:24) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5) at node:internal/main/run_main_module:36:49 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v22.18.0 Error: Process completed with exit code 1. ``` Signed-off-by: Luminall <140222795+Jason6987@users.noreply.github.com>
180 lines
5.4 KiB
YAML
Vendored
180 lines
5.4 KiB
YAML
Vendored
name: Build App With Pake CLI
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
platform:
|
|
description: "Platform"
|
|
required: true
|
|
default: "macos-latest"
|
|
type: choice
|
|
options:
|
|
- "windows-latest"
|
|
- "macos-latest"
|
|
- "ubuntu-24.04"
|
|
url:
|
|
description: "URL"
|
|
required: true
|
|
name:
|
|
description: "Name, English, Linux no capital"
|
|
required: true
|
|
icon:
|
|
description: "Icon, Image URL, Optional"
|
|
required: false
|
|
width:
|
|
description: "Width, Optional"
|
|
required: false
|
|
default: "1200"
|
|
height:
|
|
description: "Height, Optional"
|
|
required: false
|
|
default: "780"
|
|
fullscreen:
|
|
description: "Fullscreen, At startup, Optional"
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
hide_title_bar:
|
|
description: "Hide TitleBar, MacOS only, Optional"
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
multi_arch:
|
|
description: "MultiArch, MacOS only, Optional"
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
targets:
|
|
description: "Targets, Linux only, Optional"
|
|
required: false
|
|
default: "deb"
|
|
type: choice
|
|
options:
|
|
- "deb"
|
|
- "appimage"
|
|
- "rpm"
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ inputs.platform }}
|
|
runs-on: ${{ inputs.platform }}
|
|
strategy:
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: "npm"
|
|
|
|
- name: Install Rust for ubuntu-24.04
|
|
if: inputs.platform == 'ubuntu-24.04'
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
target: x86_64-unknown-linux-musl
|
|
|
|
- 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
|
|
if: inputs.platform == 'macos-latest'
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
target: x86_64-apple-darwin
|
|
|
|
- name: Add additional Rust target for multi-arch
|
|
if: inputs.platform == 'macos-latest' && inputs.multi_arch == true
|
|
run: |
|
|
rustup target add aarch64-apple-darwin
|
|
|
|
- name: Install dependencies (ubuntu only)
|
|
if: inputs.platform == 'ubuntu-24.04'
|
|
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
|
|
with:
|
|
packages: libsoup-3.0-dev libdbus-1-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra
|
|
version: 1.1
|
|
|
|
- name: Cache Node dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
node_modules
|
|
~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install pake-cli
|
|
shell: bash
|
|
run: |
|
|
echo "Installing latest pake-cli..."
|
|
npm install pake-cli@latest --no-package-lock
|
|
|
|
# Verify installation
|
|
if [ ! -d "node_modules/pake-cli" ]; then
|
|
echo "Error: Failed to install pake-cli"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Listing pake-cli contents:"
|
|
ls -la node_modules/pake-cli/ | head -5
|
|
echo "pake-cli installation verified"
|
|
|
|
- name: Rust cache restore
|
|
uses: actions/cache/restore@v4.2.0
|
|
id: cache_store
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
node_modules/pake-cli/src-tauri/target/
|
|
key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
|
|
|
|
- name: Build with pake-cli
|
|
timeout-minutes: 15
|
|
run: |
|
|
node ./scripts/github-action-build.js
|
|
env:
|
|
URL: ${{ inputs.url }}
|
|
NAME: ${{ inputs.name }}
|
|
ICON: ${{ inputs.icon }}
|
|
HEIGHT: ${{ inputs.height }}
|
|
WIDTH: ${{ inputs.width }}
|
|
HIDE_TITLE_BAR: ${{ inputs.hide_title_bar }}
|
|
FULLSCREEN: ${{ inputs.fullscreen }}
|
|
MULTI_ARCH: ${{ inputs.multi_arch }}
|
|
TARGETS: ${{ inputs.targets }}
|
|
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig
|
|
PKG_CONFIG_ALLOW_SYSTEM_LIBS: 1
|
|
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS: 1
|
|
|
|
- name: Upload archive
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: output-${{ inputs.platform }}.zip
|
|
path: node_modules/pake-cli/output/*
|
|
retention-days: 3
|
|
|
|
- name: Rust cache store
|
|
uses: actions/cache/save@v4.2.0
|
|
if: steps.cache_store.outputs.cache-hit != 'true'
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
node_modules/pake-cli/src-tauri/target/
|
|
key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
|