Улучшение CI/CD

This commit is contained in:
RoyceDa
2026-03-24 16:11:27 +02:00
parent 57be4631f2
commit 1333eb40ce

View File

@@ -8,7 +8,7 @@ on:
branches:
- main
paths:
- 'lib/**'
- 'lib/**'
jobs:
build:
@@ -17,10 +17,13 @@ jobs:
fail-fast: false
matrix:
arch: [x64, arm64]
env:
ARCH: ${{ matrix.arch }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
@@ -53,28 +56,32 @@ jobs:
- name: Install npm dependencies
run: npm install --no-audit --no-fund
- name: Build the application (${{ matrix.arch }})
- name: Debug ARCH
run: |
npx electron-vite build
npx electron-builder --linux --${{ matrix.arch }}
echo "matrix.arch = ${{ matrix.arch }}"
echo "ARCH = $ARCH"
- name: Check if files exist (${{ matrix.arch }})
- name: Build the application (${{ env.ARCH }})
run: |
mkdir -p dist/builds/linux/$ARCH
mkdir -p dist/builds/linux/x86_64
npx electron-vite build
npx electron-builder --linux --$ARCH
- name: Check if files exist (${{ env.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"
find dist/builds/linux/$ARCH -type f -name "*.AppImage" 2>/dev/null || echo "No AppImage files found"
ls -la dist/builds/linux/$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
- name: Upload ${{ env.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 }}"
source: dist/builds/linux/${{ env.ARCH }}/Rosetta-*.AppImage
target: ${{ secrets.SDU_SSH_KERNEL }}/linux/${{ env.ARCH }}
strip_components: 4
rm: true