80 lines
2.4 KiB
YAML
80 lines
2.4 KiB
YAML
name: Linux Kernel Build
|
|
run-name: Build and Upload Linux Kernel
|
|
|
|
#Запускаем только кнопкой "Run workflow" в Actions
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'lib/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch: [x64, arm64]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Cache npm dependencies
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-linux-npm-${{ hashFiles('**/package.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-linux-npm-
|
|
if-no-files-found: ignore
|
|
|
|
- name: Cache electron-builder
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: |
|
|
~/.cache/electron
|
|
key: ${{ runner.os }}-linux-electron-builder-${{ hashFiles('**/electron-builder.yml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-linux-electron-builder-
|
|
if-no-files-found: ignore
|
|
|
|
- name: NPM offline setup
|
|
run: |
|
|
npm config set cache ~/.npm --global
|
|
npm config set prefer-offline true --global
|
|
|
|
- name: Install npm dependencies
|
|
run: npm install --no-audit --no-fund
|
|
|
|
- name: Build the application (${{ matrix.arch }})
|
|
run: |
|
|
npx electron-vite build
|
|
npx electron-builder --linux --${{ matrix.arch }}
|
|
|
|
- name: Check if files exist (${{ matrix.arch }})
|
|
run: |
|
|
echo "=== Checking dist structure ==="
|
|
find dist/builds/linux/${{ matrix.arch }} -type f -name "*.AppImage" 2>/dev/null || echo "No AppImage files found"
|
|
ls -la dist/builds/linux/${{ matrix.arch }}/ 2>/dev/null || echo "arch folder not found"
|
|
|
|
- name: Install SCP in Docker container
|
|
run: apt-get install -y openssh-client
|
|
|
|
- name: Upload ${{ matrix.arch }} to SSH using SCP
|
|
uses: appleboy/scp-action@master
|
|
with:
|
|
host: ${{ secrets.SDU_SSH_HOST }}
|
|
username: ${{ secrets.SDU_SSH_USERNAME }}
|
|
password: ${{ secrets.SDU_SSH_PASSWORD }}
|
|
port: 22
|
|
source: "dist/builds/linux/${{ matrix.arch }}/Rosetta-*.AppImage"
|
|
target: "${{ secrets.SDU_SSH_KERNEL }}/linux/${{ matrix.arch }}"
|
|
strip_components: 4
|
|
rm: true |