Улучшение CI/CD
This commit is contained in:
@@ -51,24 +51,25 @@ jobs:
|
|||||||
- name: NPM offline setup
|
- name: NPM offline setup
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
mkdir -p dist/builds/darwin/arm64 dist/builds/darwin/x64
|
||||||
npm config set cache "$HOME/.npm-cache" --global
|
npm config set cache "$HOME/.npm-cache" --global
|
||||||
npm config set prefer-offline true --global
|
npm config set prefer-offline true --global
|
||||||
|
|
||||||
- name: Install npm dependencies
|
- name: Install npm dependencies
|
||||||
run: npm install --prefer-offline --no-audit --no-fund
|
run: npm install --prefer-offline --no-audit --no-fund
|
||||||
|
|
||||||
- name: Build the application (${{ matrix.arch }})
|
- name: Build the application
|
||||||
run: |
|
run: |
|
||||||
npx electron-vite build
|
npx electron-vite build
|
||||||
npx electron-builder --mac --${{ matrix.arch }}
|
npx electron-builder --mac --${{ matrix.arch }}
|
||||||
|
|
||||||
- name: Check if files exist (${{ matrix.arch }})
|
- name: Check if files exist
|
||||||
run: |
|
run: |
|
||||||
echo "=== Checking dist structure ==="
|
echo "=== Checking dist structure ==="
|
||||||
find dist/builds/darwin/${{ matrix.arch }} -type f -name "*.pkg" 2>/dev/null || echo "No PKG files found"
|
find dist/builds/darwin/${{ matrix.arch }} -type f -name "*.pkg" 2>/dev/null || echo "No PKG files found"
|
||||||
ls -la dist/builds/darwin/${{ matrix.arch }}/ 2>/dev/null || echo "arch folder not found"
|
ls -la dist/builds/darwin/${{ matrix.arch }}/ 2>/dev/null || echo "arch folder not found"
|
||||||
|
|
||||||
- name: Upload ${{ matrix.arch }} to SSH using SCP
|
- name: Upload to SSH using SCP
|
||||||
uses: appleboy/scp-action@master
|
uses: appleboy/scp-action@master
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SDU_SSH_HOST }}
|
host: ${{ secrets.SDU_SSH_HOST }}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
name: Linux Kernel Build
|
name: Linux Kernel Build
|
||||||
run-name: Build and Upload Linux Kernel
|
run-name: Build and Upload Linux Kernel
|
||||||
|
|
||||||
#Запускаем только кнопкой "Run workflow" в Actions
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
@@ -16,7 +15,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
arch: [x64, arm64]
|
include:
|
||||||
|
- arch: x64
|
||||||
|
out_dir: x86_64
|
||||||
|
- arch: arm64
|
||||||
|
out_dir: arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -32,20 +35,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Debug ARCH
|
- name: Debug ARCH
|
||||||
run: |
|
run: |
|
||||||
echo "matrix.arch = ${{ matrix.arch }}"
|
echo "arch=${{ matrix.arch }}"
|
||||||
|
echo "out_dir=${{ matrix.out_dir }}"
|
||||||
|
|
||||||
- name: Build the application
|
- name: Build the application
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist/builds/linux/${{ matrix.arch }}
|
mkdir -p dist/builds/linux/${{ matrix.out_dir }}
|
||||||
mkdir -p dist/builds/linux/x86_64
|
|
||||||
npx electron-vite build
|
npx electron-vite build
|
||||||
npx electron-builder --linux --${{ matrix.arch }}
|
npx electron-builder --linux --${{ matrix.arch }}
|
||||||
|
|
||||||
- name: Check if files exist
|
- name: Check if files exist
|
||||||
run: |
|
run: |
|
||||||
echo "=== Checking dist structure ==="
|
echo "=== Checking dist structure ==="
|
||||||
find dist/builds/linux/${{ matrix.arch }} -type f -name "*.AppImage" 2>/dev/null || echo "No AppImage files found"
|
find dist/builds/linux/${{ matrix.out_dir }} -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"
|
ls -la dist/builds/linux/${{ matrix.out_dir }}/ 2>/dev/null || echo "arch folder not found"
|
||||||
|
|
||||||
- name: Upload to SSH using SCP
|
- name: Upload to SSH using SCP
|
||||||
uses: appleboy/scp-action@master
|
uses: appleboy/scp-action@master
|
||||||
@@ -54,7 +57,7 @@ jobs:
|
|||||||
username: ${{ secrets.SDU_SSH_USERNAME }}
|
username: ${{ secrets.SDU_SSH_USERNAME }}
|
||||||
password: ${{ secrets.SDU_SSH_PASSWORD }}
|
password: ${{ secrets.SDU_SSH_PASSWORD }}
|
||||||
port: 22
|
port: 22
|
||||||
source: dist/builds/linux/${{ matrix.arch }}/Rosetta-*.AppImage
|
source: dist/builds/linux/${{ matrix.out_dir }}/Rosetta-*.AppImage
|
||||||
target: ${{ secrets.SDU_SSH_KERNEL }}/linux/${{ matrix.arch }}
|
target: ${{ secrets.SDU_SSH_KERNEL }}/linux/${{ matrix.arch }}
|
||||||
strip_components: 4
|
strip_components: 4
|
||||||
rm: true
|
rm: true
|
||||||
Reference in New Issue
Block a user